Auto merge of #2753 - RalfJung:rustup, r=RalfJung
Rustup Pulls in https://github.com/rust-lang/rust/pull/104658
This commit is contained in:
commit
d61d359d5e
807 changed files with 11197 additions and 6287 deletions
|
|
@ -36,6 +36,7 @@ dependencies = [
|
|||
name = "bootstrap"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"build_helper",
|
||||
"cc",
|
||||
"cmake",
|
||||
"fd-lock",
|
||||
|
|
@ -70,6 +71,10 @@ dependencies = [
|
|||
"regex-automata",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "build_helper"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.73"
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ path = "bin/sccache-plus-cl.rs"
|
|||
test = false
|
||||
|
||||
[dependencies]
|
||||
build_helper = { path = "../tools/build_helper" }
|
||||
cmake = "0.1.38"
|
||||
fd-lock = "3.0.8"
|
||||
filetime = "0.2"
|
||||
|
|
|
|||
|
|
@ -934,8 +934,7 @@ def main():
|
|||
if len(sys.argv) > 1 and sys.argv[1] == 'help':
|
||||
sys.argv = [sys.argv[0], '-h'] + sys.argv[2:]
|
||||
|
||||
help_triggered = (
|
||||
'-h' in sys.argv) or ('--help' in sys.argv) or (len(sys.argv) == 1)
|
||||
help_triggered = len(sys.argv) == 1 or any(x in ["-h", "--help", "--version"] for x in sys.argv)
|
||||
try:
|
||||
bootstrap(help_triggered)
|
||||
if not help_triggered:
|
||||
|
|
|
|||
|
|
@ -2067,6 +2067,9 @@ impl Step for RustDev {
|
|||
|
||||
builder.ensure(crate::native::Llvm { target });
|
||||
|
||||
// We want to package `lld` to use it with `download-ci-llvm`.
|
||||
builder.ensure(crate::native::Lld { target });
|
||||
|
||||
let src_bindir = builder.llvm_out(target).join("bin");
|
||||
// If updating this list, you likely want to change
|
||||
// src/bootstrap/download-ci-llvm-stamp as well, otherwise local users
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Change this file to make users of the `download-ci-llvm` configuration download
|
||||
a new version of LLVM from CI, even if the LLVM submodule hasn’t changed.
|
||||
|
||||
Last change is for: https://github.com/rust-lang/rust/pull/102790
|
||||
Last change is for: https://github.com/rust-lang/rust/pull/104748
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
//! Runs rustfmt on the repository.
|
||||
|
||||
use crate::builder::Builder;
|
||||
use crate::util::{output, program_out_of_date, t};
|
||||
use crate::util::{output, output_result, program_out_of_date, t};
|
||||
use build_helper::git::updated_master_branch;
|
||||
use ignore::WalkBuilder;
|
||||
use std::collections::VecDeque;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
|
@ -78,50 +79,24 @@ fn update_rustfmt_version(build: &Builder<'_>) {
|
|||
/// rust-lang/master and what is now on the disk.
|
||||
///
|
||||
/// Returns `None` if all files should be formatted.
|
||||
fn get_modified_rs_files(build: &Builder<'_>) -> Option<Vec<String>> {
|
||||
let Ok(remote) = get_rust_lang_rust_remote() else { return None; };
|
||||
fn get_modified_rs_files(build: &Builder<'_>) -> Result<Option<Vec<String>>, String> {
|
||||
let Ok(updated_master) = updated_master_branch(Some(&build.config.src)) else { return Ok(None); };
|
||||
|
||||
if !verify_rustfmt_version(build) {
|
||||
return None;
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let merge_base =
|
||||
output(build.config.git().arg("merge-base").arg(&format!("{remote}/master")).arg("HEAD"));
|
||||
Some(
|
||||
output(build.config.git().arg("diff-index").arg("--name-only").arg(merge_base.trim()))
|
||||
.lines()
|
||||
.map(|s| s.trim().to_owned())
|
||||
.filter(|f| Path::new(f).extension().map_or(false, |ext| ext == "rs"))
|
||||
.collect(),
|
||||
)
|
||||
}
|
||||
|
||||
/// Finds the remote for rust-lang/rust.
|
||||
/// For example for these remotes it will return `upstream`.
|
||||
/// ```text
|
||||
/// origin https://github.com/Nilstrieb/rust.git (fetch)
|
||||
/// origin https://github.com/Nilstrieb/rust.git (push)
|
||||
/// upstream https://github.com/rust-lang/rust (fetch)
|
||||
/// upstream https://github.com/rust-lang/rust (push)
|
||||
/// ```
|
||||
fn get_rust_lang_rust_remote() -> Result<String, String> {
|
||||
let mut git = Command::new("git");
|
||||
git.args(["config", "--local", "--get-regex", "remote\\..*\\.url"]);
|
||||
|
||||
let output = git.output().map_err(|err| format!("{err:?}"))?;
|
||||
if !output.status.success() {
|
||||
return Err("failed to execute git config command".to_owned());
|
||||
}
|
||||
|
||||
let stdout = String::from_utf8(output.stdout).map_err(|err| format!("{err:?}"))?;
|
||||
|
||||
let rust_lang_remote = stdout
|
||||
output_result(build.config.git().arg("merge-base").arg(&updated_master).arg("HEAD"))?;
|
||||
Ok(Some(
|
||||
output_result(
|
||||
build.config.git().arg("diff-index").arg("--name-only").arg(merge_base.trim()),
|
||||
)?
|
||||
.lines()
|
||||
.find(|remote| remote.contains("rust-lang"))
|
||||
.ok_or_else(|| "rust-lang/rust remote not found".to_owned())?;
|
||||
|
||||
let remote_name =
|
||||
rust_lang_remote.split('.').nth(1).ok_or_else(|| "remote name not found".to_owned())?;
|
||||
Ok(remote_name.into())
|
||||
.map(|s| s.trim().to_owned())
|
||||
.filter(|f| Path::new(f).extension().map_or(false, |ext| ext == "rs"))
|
||||
.collect(),
|
||||
))
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
|
|
@ -158,6 +133,9 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
|
|||
Ok(status) => status.success(),
|
||||
Err(_) => false,
|
||||
};
|
||||
|
||||
let mut paths = paths.to_vec();
|
||||
|
||||
if git_available {
|
||||
let in_working_tree = match build
|
||||
.config
|
||||
|
|
@ -191,10 +169,21 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
|
|||
ignore_fmt.add(&format!("!/{}", untracked_path)).expect(&untracked_path);
|
||||
}
|
||||
if !check && paths.is_empty() {
|
||||
if let Some(files) = get_modified_rs_files(build) {
|
||||
for file in files {
|
||||
println!("formatting modified file {file}");
|
||||
ignore_fmt.add(&format!("/{file}")).expect(&file);
|
||||
match get_modified_rs_files(build) {
|
||||
Ok(Some(files)) => {
|
||||
for file in files {
|
||||
println!("formatting modified file {file}");
|
||||
ignore_fmt.add(&format!("/{file}")).expect(&file);
|
||||
}
|
||||
}
|
||||
Ok(None) => {}
|
||||
Err(err) => {
|
||||
println!(
|
||||
"WARN: Something went wrong when running git commands:\n{err}\n\
|
||||
Falling back to formatting all files."
|
||||
);
|
||||
// Something went wrong when getting the version. Just format all the files.
|
||||
paths.push(".".into());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -204,6 +193,7 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
|
|||
} else {
|
||||
println!("Could not find usable git. Skipping git-aware format checks");
|
||||
}
|
||||
|
||||
let ignore_fmt = ignore_fmt.build().unwrap();
|
||||
|
||||
let rustfmt_path = build.initial_rustfmt().unwrap_or_else(|| {
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ use std::path::{Path, PathBuf};
|
|||
use std::process::Command;
|
||||
use std::str;
|
||||
|
||||
use build_helper::ci::CiEnv;
|
||||
use channel::GitInfo;
|
||||
use config::{DryRun, Target};
|
||||
use filetime::FileTime;
|
||||
|
|
@ -121,7 +122,7 @@ use once_cell::sync::OnceCell;
|
|||
use crate::builder::Kind;
|
||||
use crate::config::{LlvmLibunwind, TargetSelection};
|
||||
use crate::util::{
|
||||
exe, libdir, mtime, output, run, run_suppressed, symlink_dir, try_run_suppressed, CiEnv,
|
||||
exe, libdir, mtime, output, run, run_suppressed, symlink_dir, try_run_suppressed,
|
||||
};
|
||||
|
||||
mod bolt;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ use crate::util::get_clang_cl_resource_dir;
|
|||
use crate::util::{self, exe, output, t, up_to_date};
|
||||
use crate::{CLang, GitRepo};
|
||||
|
||||
use build_helper::ci::CiEnv;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct LlvmResult {
|
||||
/// Path to llvm-config binary.
|
||||
|
|
@ -63,13 +65,13 @@ impl LdFlags {
|
|||
}
|
||||
}
|
||||
|
||||
// This returns whether we've already previously built LLVM.
|
||||
//
|
||||
// It's used to avoid busting caches during x.py check -- if we've already built
|
||||
// LLVM, it's fine for us to not try to avoid doing so.
|
||||
//
|
||||
// This will return the llvm-config if it can get it (but it will not build it
|
||||
// if not).
|
||||
/// This returns whether we've already previously built LLVM.
|
||||
///
|
||||
/// It's used to avoid busting caches during x.py check -- if we've already built
|
||||
/// LLVM, it's fine for us to not try to avoid doing so.
|
||||
///
|
||||
/// This will return the llvm-config if it can get it (but it will not build it
|
||||
/// if not).
|
||||
pub fn prebuilt_llvm_config(
|
||||
builder: &Builder<'_>,
|
||||
target: TargetSelection,
|
||||
|
|
@ -217,7 +219,7 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {
|
|||
return false;
|
||||
}
|
||||
|
||||
if crate::util::CiEnv::is_ci() {
|
||||
if CiEnv::is_ci() {
|
||||
// We assume we have access to git, so it's okay to unconditionally pass
|
||||
// `true` here.
|
||||
let llvm_sha = detect_llvm_sha(config, true);
|
||||
|
|
@ -823,8 +825,21 @@ impl Step for Lld {
|
|||
}
|
||||
let target = self.target;
|
||||
|
||||
let LlvmResult { llvm_config, llvm_cmake_dir } =
|
||||
builder.ensure(Llvm { target: self.target });
|
||||
let LlvmResult { llvm_config, llvm_cmake_dir } = builder.ensure(Llvm { target });
|
||||
|
||||
// The `dist` step packages LLD next to LLVM's binaries for download-ci-llvm. The root path
|
||||
// we usually expect here is `./build/$triple/ci-llvm/`, with the binaries in its `bin`
|
||||
// subfolder. We check if that's the case, and if LLD's binary already exists there next to
|
||||
// `llvm-config`: if so, we can use it instead of building LLVM/LLD from source.
|
||||
let ci_llvm_bin = llvm_config.parent().unwrap();
|
||||
if ci_llvm_bin.is_dir() && ci_llvm_bin.file_name().unwrap() == "bin" {
|
||||
let lld_path = ci_llvm_bin.join(exe("lld", target));
|
||||
if lld_path.exists() {
|
||||
// The following steps copying `lld` as `rust-lld` to the sysroot, expect it in the
|
||||
// `bin` subfolder of this step's out dir.
|
||||
return ci_llvm_bin.parent().unwrap().to_path_buf();
|
||||
}
|
||||
}
|
||||
|
||||
let out_dir = builder.lld_out(target);
|
||||
let done_stamp = out_dir.join("lld-finished-building");
|
||||
|
|
@ -1072,12 +1087,12 @@ fn supported_sanitizers(
|
|||
|
||||
match &*target.triple {
|
||||
"aarch64-apple-darwin" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
|
||||
"aarch64-fuchsia" => common_libs("fuchsia", "aarch64", &["asan"]),
|
||||
"aarch64-unknown-fuchsia" => common_libs("fuchsia", "aarch64", &["asan"]),
|
||||
"aarch64-unknown-linux-gnu" => {
|
||||
common_libs("linux", "aarch64", &["asan", "lsan", "msan", "tsan", "hwasan"])
|
||||
}
|
||||
"x86_64-apple-darwin" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
|
||||
"x86_64-fuchsia" => common_libs("fuchsia", "x86_64", &["asan"]),
|
||||
"x86_64-unknown-fuchsia" => common_libs("fuchsia", "x86_64", &["asan"]),
|
||||
"x86_64-unknown-freebsd" => common_libs("freebsd", "x86_64", &["asan", "msan", "tsan"]),
|
||||
"x86_64-unknown-netbsd" => {
|
||||
common_libs("netbsd", "x86_64", &["asan", "lsan", "msan", "tsan"])
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ impl Step for BumpStage0 {
|
|||
|
||||
fn run(self, builder: &Builder<'_>) -> Self::Output {
|
||||
let mut cmd = builder.tool_cmd(Tool::BumpStage0);
|
||||
cmd.args(builder.config.cmd.args());
|
||||
builder.run(&mut cmd);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ pub fn interactive_path() -> io::Result<Profile> {
|
|||
Ok(template)
|
||||
}
|
||||
|
||||
// install a git hook to automatically run tidy --bless, if they want
|
||||
// install a git hook to automatically run tidy, if they want
|
||||
fn install_git_hook_maybe(config: &Config) -> io::Result<()> {
|
||||
let git = t!(config.git().args(&["rev-parse", "--git-common-dir"]).output().map(|output| {
|
||||
assert!(output.status.success(), "failed to run `git`");
|
||||
|
|
@ -367,7 +367,7 @@ fn install_git_hook_maybe(config: &Config) -> io::Result<()> {
|
|||
println!();
|
||||
println!(
|
||||
"Rust's CI will automatically fail if it doesn't pass `tidy`, the internal tool for ensuring code quality.
|
||||
If you'd like, x.py can install a git hook for you that will automatically run `tidy --bless` before
|
||||
If you'd like, x.py can install a git hook for you that will automatically run `test tidy` before
|
||||
pushing your code to ensure your code is up to par. If you decide later that this behavior is
|
||||
undesirable, simply delete the `pre-push` file from .git/hooks."
|
||||
);
|
||||
|
|
|
|||
|
|
@ -255,35 +255,6 @@ pub enum CiEnv {
|
|||
GitHubActions,
|
||||
}
|
||||
|
||||
impl CiEnv {
|
||||
/// Obtains the current CI environment.
|
||||
pub fn current() -> CiEnv {
|
||||
if env::var("TF_BUILD").map_or(false, |e| e == "True") {
|
||||
CiEnv::AzurePipelines
|
||||
} else if env::var("GITHUB_ACTIONS").map_or(false, |e| e == "true") {
|
||||
CiEnv::GitHubActions
|
||||
} else {
|
||||
CiEnv::None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_ci() -> bool {
|
||||
Self::current() != CiEnv::None
|
||||
}
|
||||
|
||||
/// If in a CI environment, forces the command to run with colors.
|
||||
pub fn force_coloring_in_ci(self, cmd: &mut Command) {
|
||||
if self != CiEnv::None {
|
||||
// Due to use of stamp/docker, the output stream of rustbuild is not
|
||||
// a TTY in CI, so coloring is by-default turned off.
|
||||
// The explicit `TERM=xterm` environment is needed for
|
||||
// `--color always` to actually work. This env var was lost when
|
||||
// compiling through the Makefile. Very strange.
|
||||
cmd.env("TERM", "xterm").args(&["--color", "always"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn forcing_clang_based_tests() -> bool {
|
||||
if let Some(var) = env::var_os("RUSTBUILD_FORCE_CLANG_BASED_TESTS") {
|
||||
match &var.to_string_lossy().to_lowercase()[..] {
|
||||
|
|
@ -441,6 +412,23 @@ pub fn output(cmd: &mut Command) -> String {
|
|||
String::from_utf8(output.stdout).unwrap()
|
||||
}
|
||||
|
||||
pub fn output_result(cmd: &mut Command) -> Result<String, String> {
|
||||
let output = match cmd.stderr(Stdio::inherit()).output() {
|
||||
Ok(status) => status,
|
||||
Err(e) => return Err(format!("failed to run command: {:?}: {}", cmd, e)),
|
||||
};
|
||||
if !output.status.success() {
|
||||
return Err(format!(
|
||||
"command did not execute successfully: {:?}\n\
|
||||
expected success, got: {}\n{}",
|
||||
cmd,
|
||||
output.status,
|
||||
String::from_utf8(output.stderr).map_err(|err| format!("{err:?}"))?
|
||||
));
|
||||
}
|
||||
Ok(String::from_utf8(output.stdout).map_err(|err| format!("{err:?}"))?)
|
||||
}
|
||||
|
||||
/// Returns the last-modified time for `path`, or zero if it doesn't exist.
|
||||
pub fn mtime(path: &Path) -> SystemTime {
|
||||
fs::metadata(path).and_then(|f| f.modified()).unwrap_or(UNIX_EPOCH)
|
||||
|
|
|
|||
|
|
@ -30,18 +30,18 @@ RUN apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7
|
|||
RUN add-apt-repository -y 'deb https://apt.dilos.org/dilos dilos2 main'
|
||||
|
||||
ENV \
|
||||
AR_x86_64_fuchsia=x86_64-fuchsia-ar \
|
||||
CC_x86_64_fuchsia=x86_64-fuchsia-clang \
|
||||
CFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
|
||||
CXX_x86_64_fuchsia=x86_64-fuchsia-clang++ \
|
||||
CXXFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
|
||||
LDFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/lib" \
|
||||
AR_aarch64_fuchsia=aarch64-fuchsia-ar \
|
||||
CC_aarch64_fuchsia=aarch64-fuchsia-clang \
|
||||
CFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
|
||||
CXX_aarch64_fuchsia=aarch64-fuchsia-clang++ \
|
||||
CXXFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
|
||||
LDFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/lib" \
|
||||
AR_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-ar \
|
||||
CC_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang \
|
||||
CFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
|
||||
CXX_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang++ \
|
||||
CXXFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
|
||||
LDFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/lib" \
|
||||
AR_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-ar \
|
||||
CC_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang \
|
||||
CFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
|
||||
CXX_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang++ \
|
||||
CXXFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
|
||||
LDFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/lib" \
|
||||
AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-ar \
|
||||
CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-gcc \
|
||||
CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-g++ \
|
||||
|
|
@ -99,19 +99,19 @@ RUN /tmp/freebsd-toolchain.sh i686
|
|||
COPY scripts/sccache.sh /scripts/
|
||||
RUN sh /scripts/sccache.sh
|
||||
|
||||
ENV CARGO_TARGET_X86_64_FUCHSIA_AR /usr/local/bin/llvm-ar
|
||||
ENV CARGO_TARGET_X86_64_FUCHSIA_RUSTFLAGS \
|
||||
ENV CARGO_TARGET_X86_64_UNKNOWN_FUCHSIA_AR /usr/local/bin/llvm-ar
|
||||
ENV CARGO_TARGET_X86_64_UNKNOWN_FUCHSIA_RUSTFLAGS \
|
||||
-C link-arg=--sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot \
|
||||
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot/lib \
|
||||
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/lib
|
||||
ENV CARGO_TARGET_AARCH64_FUCHSIA_AR /usr/local/bin/llvm-ar
|
||||
ENV CARGO_TARGET_AARCH64_FUCHSIA_RUSTFLAGS \
|
||||
ENV CARGO_TARGET_AARCH64_UNKNOWN_FUCHSIA_AR /usr/local/bin/llvm-ar
|
||||
ENV CARGO_TARGET_AARCH64_UNKNOWN_FUCHSIA_RUSTFLAGS \
|
||||
-C link-arg=--sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot \
|
||||
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot/lib \
|
||||
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/lib
|
||||
|
||||
ENV TARGETS=x86_64-fuchsia
|
||||
ENV TARGETS=$TARGETS,aarch64-fuchsia
|
||||
ENV TARGETS=x86_64-unknown-fuchsia
|
||||
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
|
||||
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
|
||||
ENV TARGETS=$TARGETS,wasm32-wasi
|
||||
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ install_clang() {
|
|||
# CFLAGS and CXXFLAGS env variables in main Dockerfile handle sysroot linking
|
||||
for arch in x86_64 aarch64; do
|
||||
for tool in clang clang++; do
|
||||
ln -s /usr/local/bin/${tool} /usr/local/bin/${arch}-fuchsia-${tool}
|
||||
ln -s /usr/local/bin/${tool} /usr/local/bin/${arch}-unknown-fuchsia-${tool}
|
||||
done
|
||||
ln -s /usr/local/bin/llvm-ar /usr/local/bin/${arch}-fuchsia-ar
|
||||
ln -s /usr/local/bin/llvm-ar /usr/local/bin/${arch}-unknown-fuchsia-ar
|
||||
done
|
||||
|
||||
popd > /dev/null
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
0.13.4
|
||||
0.14.1
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
The Rust toolchain test runner for Fuchsia.
|
||||
|
||||
For instructions on running the compiler test suite, see
|
||||
https://doc.rust-lang.org/stable/rustc/platform-support/fuchsia.html#aarch64-fuchsia-and-x86_64-fuchsia
|
||||
https://doc.rust-lang.org/stable/rustc/platform-support/fuchsia.html#aarch64-unknown-fuchsia-and-x86_64-unknown-fuchsia
|
||||
"""
|
||||
|
||||
import argparse
|
||||
|
|
@ -110,9 +110,9 @@ class TestEnvironment:
|
|||
|
||||
def rustlib_dir(self):
|
||||
if self.target_arch == "x64":
|
||||
return "x86_64-fuchsia"
|
||||
return "x86_64-unknown-fuchsia"
|
||||
if self.target_arch == "arm64":
|
||||
return "aarch64-fuchsia"
|
||||
return "aarch64-unknown-fuchsia"
|
||||
raise Exception(f"Unrecognized target architecture {self.target_arch}")
|
||||
|
||||
def libs_dir(self):
|
||||
|
|
|
|||
|
|
@ -22,10 +22,11 @@
|
|||
- [armv4t-none-eabi](platform-support/armv4t-none-eabi.md)
|
||||
- [armv5te-none-eabi](platform-support/armv5te-none-eabi.md)
|
||||
- [armv6k-nintendo-3ds](platform-support/armv6k-nintendo-3ds.md)
|
||||
- [armv7-sony-vita-newlibeabihf](platform-support/armv7-sony-vita-newlibeabihf.md)
|
||||
- [armv7-unknown-linux-uclibceabi](platform-support/armv7-unknown-linux-uclibceabi.md)
|
||||
- [armv7-unknown-linux-uclibceabihf](platform-support/armv7-unknown-linux-uclibceabihf.md)
|
||||
- [\*-android and \*-androideabi](platform-support/android.md)
|
||||
- [\*-fuchsia](platform-support/fuchsia.md)
|
||||
- [\*-unknown-fuchsia](platform-support/fuchsia.md)
|
||||
- [\*-kmc-solid_\*](platform-support/kmc-solid.md)
|
||||
- [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md)
|
||||
- [mips64-openwrt-linux-musl](platform-support/mips64-openwrt-linux-musl.md)
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ target | std | notes
|
|||
-------|:---:|-------
|
||||
`aarch64-apple-ios` | ✓ | ARM64 iOS
|
||||
[`aarch64-apple-ios-sim`](platform-support/aarch64-apple-ios-sim.md) | ✓ | Apple iOS Simulator on ARM64
|
||||
`aarch64-fuchsia` | ✓ | ARM64 Fuchsia
|
||||
`aarch64-unknown-fuchsia` | ✓ | ARM64 Fuchsia
|
||||
[`aarch64-linux-android`](platform-support/android.md) | ✓ | ARM64 Android
|
||||
`aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat
|
||||
`aarch64-unknown-none` | * | Bare ARM64, hardfloat
|
||||
|
|
@ -177,7 +177,7 @@ target | std | notes
|
|||
`wasm32-wasi` | ✓ | WebAssembly with WASI
|
||||
`x86_64-apple-ios` | ✓ | 64-bit x86 iOS
|
||||
[`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX
|
||||
`x86_64-fuchsia` | ✓ | 64-bit Fuchsia
|
||||
`x86_64-unknown-fuchsia` | ✓ | 64-bit Fuchsia
|
||||
[`x86_64-linux-android`](platform-support/android.md) | ✓ | 64-bit x86 Android
|
||||
`x86_64-pc-solaris` | ✓ | 64-bit Solaris 10/11, illumos
|
||||
`x86_64-unknown-linux-gnux32` | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15, glibc 2.27)
|
||||
|
|
@ -235,6 +235,7 @@ target | std | host | notes
|
|||
`armv6-unknown-netbsd-eabihf` | ? | |
|
||||
[`armv6k-nintendo-3ds`](platform-support/armv6k-nintendo-3ds.md) | ? | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
|
||||
`armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8
|
||||
[`armv7-sony-vita-newlibeabihf`](platform-support/armv7-sony-vita-newlibeabihf.md) | ? | | ARM Cortex-A9 Sony PlayStation Vita (requires VITASDK toolchain)
|
||||
[`armv7-unknown-linux-uclibceabi`](platform-support/armv7-unknown-linux-uclibceabi.md) | ✓ | ✓ | ARMv7 Linux with uClibc, softfloat
|
||||
[`armv7-unknown-linux-uclibceabihf`](platform-support/armv7-unknown-linux-uclibceabihf.md) | ✓ | ? | ARMv7 Linux with uClibc, hardfloat
|
||||
`armv7-unknown-freebsd` | ✓ | ✓ | ARMv7 FreeBSD
|
||||
|
|
|
|||
127
src/doc/rustc/src/platform-support/armv7-sony-vita-eabihf.md
Normal file
127
src/doc/rustc/src/platform-support/armv7-sony-vita-eabihf.md
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
# armv7-sony-vita-eabihf
|
||||
|
||||
**Tier: 3**
|
||||
|
||||
This tier supports the ARM Cortex A9 processor running on a PlayStation Vita console. `armv7-vita-newlibeabihf` aims to have support for `std` crate using `newlib` as a bridge.
|
||||
|
||||
## Designated Developers
|
||||
|
||||
* [@amg98](https://github.com/amg98)
|
||||
|
||||
## Requirements
|
||||
|
||||
This target is cross compiled, and requires installing [VITASDK](https://vitasdk.org/) toolchain on your system.
|
||||
|
||||
## Building
|
||||
|
||||
You can build Rust with support for the target by adding it to the `target`
|
||||
list in `config.toml`:
|
||||
|
||||
```toml
|
||||
[build]
|
||||
build-stage = 1
|
||||
target = ["armv7-sony-vita-newlibeabihf"]
|
||||
```
|
||||
|
||||
## Cross-compilation
|
||||
|
||||
This target can be cross-compiled from `x86_64` on either Windows, MacOS or Linux systems. Other hosts are not supported for cross-compilation.
|
||||
|
||||
## Testing
|
||||
|
||||
Currently there is no support to run the rustc test suite for this target.
|
||||
|
||||
## Building and Running Rust Programs
|
||||
|
||||
To test your developed rust programs for PlayStation Vita, first you have to prepare a proper executable for the device using the resulting ELF file you get from compilation step. The needed steps can be automated using tools like `cargo-make`. Use the example below as a template for your project:
|
||||
|
||||
```toml
|
||||
[env]
|
||||
TITLE = "Rust Hello World"
|
||||
TITLEID = "RUST00001"
|
||||
# At least a "sce_sys" folder should be place there for app metadata (title, icons, description...)
|
||||
# You can find sample assets for that on $VITASDK/share/gcc-arm-vita-eabi/samples/hello_world/sce_sys/
|
||||
STATIC_DIR = "static" # Folder where static assets should be placed (sce_sys folder is at $STATIC_DIR/sce_sys)
|
||||
CARGO_TARGET_DIR = { script = ["echo ${CARGO_TARGET_DIR:=target}"] }
|
||||
RUST_TARGET_PATH = { script = ["echo $(pwd)"]}
|
||||
RUST_TARGET = "armv7-sony-vita-newlibeabihf"
|
||||
CARGO_OUT_DIR = "${CARGO_TARGET_DIR}/${RUST_TARGET}/release"
|
||||
|
||||
[tasks.xbuild]
|
||||
# This is the command where you get the ELF executable file (e.g. call to cargo build)
|
||||
|
||||
[tasks.strip]
|
||||
description = "Strip the produced ELF executable."
|
||||
dependencies = ["xbuild"]
|
||||
command = "arm-vita-eabi-strip"
|
||||
args = ["-g", '${CARGO_OUT_DIR}/${CARGO_MAKE_CRATE_FS_NAME}.elf']
|
||||
|
||||
[tasks.velf]
|
||||
description = "Build an VELF executable from the obtained ELF file."
|
||||
dependencies = ["strip"]
|
||||
command = "vita-elf-create"
|
||||
args = ['${CARGO_OUT_DIR}/${CARGO_MAKE_CRATE_NAME}.elf', '${CARGO_OUT_DIR}/${CARGO_MAKE_CRATE_NAME}.velf']
|
||||
|
||||
[tasks.eboot-bin]
|
||||
description = "Build an `eboot.bin` file from the obtained VELF file."
|
||||
dependencies = ["velf"]
|
||||
command = "vita-make-fself"
|
||||
args = ["-s", '${CARGO_OUT_DIR}/${CARGO_MAKE_CRATE_NAME}.velf', '${CARGO_OUT_DIR}/eboot.bin']
|
||||
|
||||
[tasks.param-sfo]
|
||||
description = "Build the `param.sfo` manifest using with given TITLE and TITLEID."
|
||||
command = "vita-mksfoex"
|
||||
args = ["-s", 'TITLE_ID=${TITLEID}', '${TITLE}', '${CARGO_OUT_DIR}/param.sfo']
|
||||
|
||||
[tasks.manifest]
|
||||
description = "List all static resources into a manifest file."
|
||||
script = [
|
||||
'mkdir -p "${CARGO_OUT_DIR}"',
|
||||
'''
|
||||
if [ -d "${STATIC_DIR}" ]; then
|
||||
find "${STATIC_DIR}" -type f > "${CARGO_OUT_DIR}/MANIFEST"
|
||||
else
|
||||
touch "${CARGO_OUT_DIR}/MANIFEST"
|
||||
fi
|
||||
'''
|
||||
]
|
||||
|
||||
[tasks.vpk]
|
||||
description = "Build a VPK distribution of the project executable and resources."
|
||||
dependencies = ["eboot-bin", "param-sfo", "manifest"]
|
||||
script_runner = "@rust"
|
||||
script = [
|
||||
'''
|
||||
use std::io::BufRead;
|
||||
use std::fs::File;
|
||||
|
||||
fn main() {
|
||||
|
||||
let crate_name = env!("CARGO_MAKE_CRATE_NAME");
|
||||
let static_dir = env!("STATIC_DIR");
|
||||
let out_dir = std::path::PathBuf::from(env!("CARGO_OUT_DIR"));
|
||||
|
||||
let mut cmd = ::std::process::Command::new("vita-pack-vpk");
|
||||
cmd.arg("-s").arg(out_dir.join("param.sfo"));
|
||||
cmd.arg("-b").arg(out_dir.join("eboot.bin"));
|
||||
|
||||
// Add files from MANIFEST
|
||||
if let Ok(file) = File::open(out_dir.join("MANIFEST")) {
|
||||
let mut reader = ::std::io::BufReader::new(file);
|
||||
let mut lines = reader.lines();
|
||||
while let Some(Ok(line)) = lines.next() {
|
||||
let p1 = ::std::path::PathBuf::from(line); // path on FS
|
||||
let p2 = p1.strip_prefix(static_dir).unwrap(); // path in VPK
|
||||
cmd.arg("--add").arg(format!("{}={}", p1.display(), p2.display()));
|
||||
}
|
||||
}
|
||||
|
||||
cmd.arg(out_dir.join(format!("{}.vpk", crate_name)))
|
||||
.output()
|
||||
.expect("command failed.");
|
||||
}
|
||||
'''
|
||||
]
|
||||
```
|
||||
|
||||
After running the above script, you should be able to get a *.vpk file in the same folder your *.elf executable resides. Now you can pick it and install it on your own PlayStation Vita using, for example, [VitaShell](https://github.com/TheOfficialFloW/VitaShell/releases) or you can use an emulator. For the time being, the most mature emulator for PlayStation Vita is [Vita3K](https://vita3k.org/), although I personally recommend testing your programs in real hardware, as the emulator is quite experimental.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# `aarch64-fuchsia` and `x86_64-fuchsia`
|
||||
# `aarch64-unknown-fuchsia` and `x86_64-unknown-fuchsia`
|
||||
|
||||
**Tier: 2**
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ This walkthrough will cover:
|
|||
1. Building a Fuchsia package.
|
||||
1. Publishing and running a Fuchsia package to a Fuchsia emulator.
|
||||
|
||||
For the purposes of this walkthrough, we will only target `x86_64-fuchsia`.
|
||||
For the purposes of this walkthrough, we will only target `x86_64-unknown-fuchsia`.
|
||||
|
||||
## Compiling a Rust binary targeting Fuchsia
|
||||
|
||||
|
|
@ -83,8 +83,8 @@ to handle the installation of Fuchsia targets for you. This can be done by issui
|
|||
the following commands:
|
||||
|
||||
```sh
|
||||
rustup target add x86_64-fuchsia
|
||||
rustup target add aarch64-fuchsia
|
||||
rustup target add x86_64-unknown-fuchsia
|
||||
rustup target add aarch64-unknown-fuchsia
|
||||
```
|
||||
|
||||
After installing our Fuchsia targets, we can now compile a Rust binary that targets
|
||||
|
|
@ -127,7 +127,7 @@ during compilation:
|
|||
|
||||
**`.cargo/config.toml`**
|
||||
```txt
|
||||
[target.x86_64-fuchsia]
|
||||
[target.x86_64-unknown-fuchsia]
|
||||
|
||||
rustflags = [
|
||||
"-Lnative=<SDK_PATH>/arch/x64/lib",
|
||||
|
|
@ -159,10 +159,10 @@ hello_fuchsia/
|
|||
Finally, we can build our rust binary as:
|
||||
|
||||
```sh
|
||||
cargo build --target x86_64-fuchsia
|
||||
cargo build --target x86_64-unknown-fuchsia
|
||||
```
|
||||
|
||||
Now we have a Rust binary at `target/x86_64-fuchsia/debug/hello_fuchsia`,
|
||||
Now we have a Rust binary at `target/x86_64-unknown-fuchsia/debug/hello_fuchsia`,
|
||||
targeting our desired Fuchsia target.
|
||||
|
||||
**Current directory structure**
|
||||
|
|
@ -171,7 +171,7 @@ hello_fuchsia/
|
|||
┣━ src/
|
||||
┃ ┗━ main.rs
|
||||
┣━ target/
|
||||
┃ ┗━ x86_64-fuchsia/
|
||||
┃ ┗━ x86_64-unknown-fuchsia/
|
||||
┃ ┗━ debug/
|
||||
┃ ┗━ hello_fuchsia
|
||||
┣━ Cargo.toml
|
||||
|
|
@ -193,16 +193,19 @@ configuration in `config.toml`:
|
|||
|
||||
```toml
|
||||
[build]
|
||||
target = ["<host_platform>", "aarch64-fuchsia", "x86_64-fuchsia"]
|
||||
target = ["<host_platform>", "aarch64-unknown-fuchsia", "x86_64-unknown-fuchsia"]
|
||||
|
||||
[rust]
|
||||
lld = true
|
||||
|
||||
[target.x86_64-fuchsia]
|
||||
[llvm]
|
||||
download-ci-llvm = false
|
||||
|
||||
[target.x86_64-unknown-fuchsia]
|
||||
cc = "clang"
|
||||
cxx = "clang++"
|
||||
|
||||
[target.aarch64-fuchsia]
|
||||
[target.aarch64-unknown-fuchsia]
|
||||
cc = "clang"
|
||||
cxx = "clang++"
|
||||
```
|
||||
|
|
@ -233,14 +236,14 @@ a script we name `config-env.sh`:
|
|||
# Configure this environment variable to be the path to the downloaded SDK
|
||||
export SDK_PATH="<SDK path goes here>"
|
||||
|
||||
export CFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -I${SDK_PATH}/pkg/fdio/include"
|
||||
export CXXFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -I${SDK_PATH}/pkg/fdio/include"
|
||||
export LDFLAGS_aarch64_fuchsia="--target=aarch64-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -L${SDK_PATH}/arch/arm64/lib"
|
||||
export CARGO_TARGET_AARCH64_FUCHSIA_RUSTFLAGS="-C link-arg=--sysroot=${SDK_PATH}/arch/arm64/sysroot -Lnative=${SDK_PATH}/arch/arm64/sysroot/lib -Lnative=${SDK_PATH}/arch/arm64/lib"
|
||||
export CFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -I${SDK_PATH}/pkg/fdio/include"
|
||||
export CXXFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -I${SDK_PATH}/pkg/fdio/include"
|
||||
export LDFLAGS_x86_64_fuchsia="--target=x86_64-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -L${SDK_PATH}/arch/x64/lib"
|
||||
export CARGO_TARGET_X86_64_FUCHSIA_RUSTFLAGS="-C link-arg=--sysroot=${SDK_PATH}/arch/x64/sysroot -Lnative=${SDK_PATH}/arch/x64/sysroot/lib -Lnative=${SDK_PATH}/arch/x64/lib"
|
||||
export CFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -I${SDK_PATH}/pkg/fdio/include"
|
||||
export CXXFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -I${SDK_PATH}/pkg/fdio/include"
|
||||
export LDFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/arm64/sysroot -L${SDK_PATH}/arch/arm64/lib"
|
||||
export CARGO_TARGET_AARCH64_UNKNOWN_FUCHSIA_RUSTFLAGS="-C link-arg=--sysroot=${SDK_PATH}/arch/arm64/sysroot -Lnative=${SDK_PATH}/arch/arm64/sysroot/lib -Lnative=${SDK_PATH}/arch/arm64/lib"
|
||||
export CFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -I${SDK_PATH}/pkg/fdio/include"
|
||||
export CXXFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -I${SDK_PATH}/pkg/fdio/include"
|
||||
export LDFLAGS_x86_64_unknown_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=${SDK_PATH}/arch/x64/sysroot -L${SDK_PATH}/arch/x64/lib"
|
||||
export CARGO_TARGET_X86_64_UNKNOWN_FUCHSIA_RUSTFLAGS="-C link-arg=--sysroot=${SDK_PATH}/arch/x64/sysroot -Lnative=${SDK_PATH}/arch/x64/sysroot/lib -Lnative=${SDK_PATH}/arch/x64/lib"
|
||||
```
|
||||
|
||||
Finally, the Rust compiler can be built and installed:
|
||||
|
|
@ -285,7 +288,7 @@ hello_fuchsia/
|
|||
Using your freshly installed `rustc`, you can compile a binary for Fuchsia using
|
||||
the following options:
|
||||
|
||||
* `--target x86_64-fuchsia`/`--target aarch64-fuchsia`: Targets the Fuchsia
|
||||
* `--target x86_64-unknown-fuchsia`/`--target aarch64-unknown-fuchsia`: Targets the Fuchsia
|
||||
platform of your choice
|
||||
* `-Lnative ${SDK_PATH}/arch/${ARCH}/lib`: Link against Fuchsia libraries from
|
||||
the SDK
|
||||
|
|
@ -296,7 +299,7 @@ Putting it all together:
|
|||
|
||||
```sh
|
||||
# Configure these for the Fuchsia target of your choice
|
||||
TARGET_ARCH="<x86_64-fuchsia|aarch64-fuchsia>"
|
||||
TARGET_ARCH="<x86_64-unknown-fuchsia|aarch64-unknown-fuchsia>"
|
||||
ARCH="<x64|aarch64>"
|
||||
|
||||
rustc \
|
||||
|
|
@ -322,16 +325,16 @@ Before moving on, double check your directory structure:
|
|||
**Current directory structure**
|
||||
```txt
|
||||
hello_fuchsia/
|
||||
┣━ src/ (if using rustc)
|
||||
┃ ┗━ hello_fuchsia.rs ...
|
||||
┣━ bin/ ...
|
||||
┃ ┗━ hello_fuchsia ...
|
||||
┣━ src/ (if using cargo)
|
||||
┃ ┗━ main.rs ...
|
||||
┗━ target/ ...
|
||||
┗━ x86_64-fuchsia/ ...
|
||||
┗━ debug/ ...
|
||||
┗━ hello_fuchsia ...
|
||||
┣━ src/ (if using rustc)
|
||||
┃ ┗━ hello_fuchsia.rs ...
|
||||
┣━ bin/ ...
|
||||
┃ ┗━ hello_fuchsia ...
|
||||
┣━ src/ (if using cargo)
|
||||
┃ ┗━ main.rs ...
|
||||
┗━ target/ ...
|
||||
┗━ x86_64-unknown-fuchsia/ ...
|
||||
┗━ debug/ ...
|
||||
┗━ hello_fuchsia ...
|
||||
```
|
||||
|
||||
With our Rust binary built, we can move to creating a Fuchsia package.
|
||||
|
|
@ -368,7 +371,7 @@ package must contain one.
|
|||
|
||||
**`pkg/hello_fuchsia.manifest` if using cargo**
|
||||
```txt
|
||||
bin/hello_fuchsia=target/x86_64-fuchsia/debug/hello_fuchsia
|
||||
bin/hello_fuchsia=target/x86_64-unknown-fuchsia/debug/hello_fuchsia
|
||||
lib/ld.so.1=<SDK_PATH>/arch/x64/sysroot/dist/lib/ld.so.1
|
||||
lib/libfdio.so=<SDK_PATH>/arch/x64/dist/libfdio.so
|
||||
meta/package=pkg/meta/package
|
||||
|
|
@ -543,16 +546,16 @@ structure will look like:
|
|||
**Final directory structure**
|
||||
```txt
|
||||
hello_fuchsia/
|
||||
┣━ src/ (if using rustc)
|
||||
┃ ┗━ hello_fuchsia.rs ...
|
||||
┣━ bin/ ...
|
||||
┃ ┗━ hello_fuchsia ...
|
||||
┣━ src/ (if using cargo)
|
||||
┃ ┗━ main.rs ...
|
||||
┣━ target/ ...
|
||||
┃ ┗━ x86_64-fuchsia/ ...
|
||||
┃ ┗━ debug/ ...
|
||||
┃ ┗━ hello_fuchsia ...
|
||||
┣━ src/ (if using rustc)
|
||||
┃ ┗━ hello_fuchsia.rs ...
|
||||
┣━ bin/ ...
|
||||
┃ ┗━ hello_fuchsia ...
|
||||
┣━ src/ (if using cargo)
|
||||
┃ ┗━ main.rs ...
|
||||
┣━ target/ ...
|
||||
┃ ┗━ x86_64-unknown-fuchsia/ ...
|
||||
┃ ┗━ debug/ ...
|
||||
┃ ┗━ hello_fuchsia ...
|
||||
┗━ pkg/
|
||||
┣━ meta/
|
||||
┃ ┣━ package
|
||||
|
|
@ -641,8 +644,8 @@ Tests can be run in the same way as a regular binary.
|
|||
|
||||
* If using `cargo`, you can simply pass `test --no-run`
|
||||
to the `cargo` invocation and then repackage and rerun the Fuchsia package. From our previous example,
|
||||
this would look like `cargo test --target x86_64-fuchsia --no-run`, and moving the executable
|
||||
binary path found from the line `Executable unittests src/main.rs (target/x86_64-fuchsia/debug/deps/hello_fuchsia-<HASH>)`
|
||||
this would look like `cargo test --target x86_64-unknown-fuchsia --no-run`, and moving the executable
|
||||
binary path found from the line `Executable unittests src/main.rs (target/x86_64-unknown-fuchsia/debug/deps/hello_fuchsia-<HASH>)`
|
||||
into `pkg/hello_fuchsia.manifest`.
|
||||
|
||||
* If using the compiled `rustc`, you can simply pass `--test`
|
||||
|
|
@ -711,7 +714,7 @@ run the full `src/test/ui` test suite:
|
|||
--config config.toml \
|
||||
--stage=2 \
|
||||
test src/test/ui \
|
||||
--target x86_64-fuchsia \
|
||||
--target x86_64-unknown-fuchsia \
|
||||
--run=always --jobs 1 \
|
||||
--test-args --target-rustcflags \
|
||||
--test-args -L \
|
||||
|
|
@ -755,7 +758,7 @@ directory to launch `zxdb`:
|
|||
**In separate terminal**
|
||||
```sh
|
||||
${SDK_PATH}/tools/${ARCH}/ffx debug connect -- \
|
||||
--symbol-path target/x86_64-fuchsia/debug
|
||||
--symbol-path target/x86_64-unknown-fuchsia/debug
|
||||
```
|
||||
|
||||
* `--symbol-path` gets required symbol paths, which are
|
||||
|
|
@ -851,7 +854,7 @@ source code:
|
|||
|
||||
```sh
|
||||
${SDK_PATH}/tools/${ARCH}/ffx debug connect -- \
|
||||
--symbol-path target/x86_64-fuchsia/debug \
|
||||
--symbol-path target/x86_64-unknown-fuchsia/debug \
|
||||
--build-dir ${RUST_SRC_PATH}/rust \
|
||||
--build-dir ${FUCHSIA_SRC_PATH}/fuchsia/out/default
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
# `dump-mono-stats-format`
|
||||
|
||||
--------------------
|
||||
|
||||
The `-Z dump-mono-stats-format` compiler flag controls what file format to use for `-Z dump-mono-stats`.
|
||||
The default is markdown; currently JSON is also supported. JSON can be useful for programatically manipulating the results (e.g. to find the item that took the longest to compile).
|
||||
14
src/doc/unstable-book/src/compiler-flags/dump-mono-stats.md
Normal file
14
src/doc/unstable-book/src/compiler-flags/dump-mono-stats.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# `dump-mono-stats`
|
||||
|
||||
--------------------
|
||||
|
||||
The `-Z dump-mono-stats` compiler flag generates a file with a list of the monomorphized items in the current crate.
|
||||
It is useful for investigating compile times.
|
||||
|
||||
It accepts an optional directory where the file will be located. If no directory is specified, the file will be placed in the current directory.
|
||||
|
||||
See also `-Z dump-mono-stats-format` and `-Z print-mono-items`. Unlike `print-mono-items`,
|
||||
`dump-mono-stats` aggregates monomorphized items by definition and includes a size estimate of how
|
||||
large the item is when codegened.
|
||||
|
||||
See <https://rustc-dev-guide.rust-lang.org/backend/monomorph.html> for an overview of monomorphized items.
|
||||
|
|
@ -50,10 +50,10 @@ with runtime flag `ASAN_OPTIONS=detect_leaks=1` on macOS.
|
|||
AddressSanitizer is supported on the following targets:
|
||||
|
||||
* `aarch64-apple-darwin`
|
||||
* `aarch64-fuchsia`
|
||||
* `aarch64-unknown-fuchsia`
|
||||
* `aarch64-unknown-linux-gnu`
|
||||
* `x86_64-apple-darwin`
|
||||
* `x86_64-fuchsia`
|
||||
* `x86_64-unknown-fuchsia`
|
||||
* `x86_64-unknown-freebsd`
|
||||
* `x86_64-unknown-linux-gnu`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Call `tidy --bless` before git push
|
||||
# Call `tidy` before git push
|
||||
# Copy this script to .git/hooks to activate,
|
||||
# and remove it from .git/hooks to deactivate.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1960,7 +1960,6 @@ pub(crate) fn clean_variant_def<'tcx>(variant: &ty::VariantDef, cx: &mut DocCont
|
|||
variant.fields.iter().map(|field| clean_middle_field(field, cx)).collect(),
|
||||
),
|
||||
None => VariantKind::Struct(VariantStruct {
|
||||
ctor_kind: None,
|
||||
fields: variant.fields.iter().map(|field| clean_middle_field(field, cx)).collect(),
|
||||
}),
|
||||
};
|
||||
|
|
@ -1985,7 +1984,6 @@ fn clean_variant_data<'tcx>(
|
|||
|
||||
let kind = match variant {
|
||||
hir::VariantData::Struct(..) => VariantKind::Struct(VariantStruct {
|
||||
ctor_kind: None,
|
||||
fields: variant.fields().iter().map(|x| clean_field(x, cx)).collect(),
|
||||
}),
|
||||
hir::VariantData::Tuple(..) => {
|
||||
|
|
|
|||
|
|
@ -2111,7 +2111,6 @@ impl Union {
|
|||
/// only as a variant in an enum.
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) struct VariantStruct {
|
||||
pub(crate) ctor_kind: Option<CtorKind>,
|
||||
pub(crate) fields: Vec<Item>,
|
||||
}
|
||||
|
||||
|
|
@ -2495,6 +2494,17 @@ impl Import {
|
|||
pub(crate) fn new_glob(source: ImportSource, should_be_displayed: bool) -> Self {
|
||||
Self { kind: ImportKind::Glob, source, should_be_displayed }
|
||||
}
|
||||
|
||||
pub(crate) fn imported_item_is_doc_hidden(&self, tcx: TyCtxt<'_>) -> bool {
|
||||
match self.source.did {
|
||||
Some(did) => tcx
|
||||
.get_attrs(did, sym::doc)
|
||||
.filter_map(ast::Attribute::meta_item_list)
|
||||
.flatten()
|
||||
.has_word(sym::hidden),
|
||||
None => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ impl<'tcx> Context<'tcx> {
|
|||
|
||||
pub(crate) fn href_from_span(&self, span: clean::Span, with_lines: bool) -> Option<String> {
|
||||
let mut root = self.root_path();
|
||||
let mut path = String::new();
|
||||
let mut path: String;
|
||||
let cnum = span.cnum(self.sess());
|
||||
|
||||
// We can safely ignore synthetic `SourceFile`s.
|
||||
|
|
@ -340,10 +340,24 @@ impl<'tcx> Context<'tcx> {
|
|||
ExternalLocation::Unknown => return None,
|
||||
};
|
||||
|
||||
sources::clean_path(&src_root, file, false, |component| {
|
||||
path.push_str(&component.to_string_lossy());
|
||||
let href = RefCell::new(PathBuf::new());
|
||||
sources::clean_path(
|
||||
&src_root,
|
||||
file,
|
||||
|component| {
|
||||
href.borrow_mut().push(component);
|
||||
},
|
||||
|| {
|
||||
href.borrow_mut().pop();
|
||||
},
|
||||
);
|
||||
|
||||
path = href.into_inner().to_string_lossy().to_string();
|
||||
|
||||
if let Some(c) = path.as_bytes().last() && *c != b'/' {
|
||||
path.push('/');
|
||||
});
|
||||
}
|
||||
|
||||
let mut fname = file.file_name().expect("source has no filename").to_os_string();
|
||||
fname.push(".html");
|
||||
path.push_str(&fname.to_string_lossy());
|
||||
|
|
|
|||
|
|
@ -1229,16 +1229,7 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean::
|
|||
w.write_str(")");
|
||||
}
|
||||
clean::VariantKind::Struct(ref s) => {
|
||||
render_struct(
|
||||
w,
|
||||
v,
|
||||
None,
|
||||
s.ctor_kind,
|
||||
&s.fields,
|
||||
" ",
|
||||
false,
|
||||
cx,
|
||||
);
|
||||
render_struct(w, v, None, None, &s.fields, " ", false, cx);
|
||||
}
|
||||
},
|
||||
_ => unreachable!(),
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
use std::cell::RefCell;
|
||||
use std::fs::{self, File};
|
||||
use std::io::prelude::*;
|
||||
use std::io::{self, BufReader};
|
||||
use std::path::{Component, Path};
|
||||
use std::rc::Rc;
|
||||
use std::rc::{Rc, Weak};
|
||||
|
||||
use itertools::Itertools;
|
||||
use rustc_data_structures::flock;
|
||||
|
|
@ -184,23 +185,26 @@ pub(super) fn write_shared(
|
|||
|
||||
use std::ffi::OsString;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Default)]
|
||||
struct Hierarchy {
|
||||
parent: Weak<Self>,
|
||||
elem: OsString,
|
||||
children: FxHashMap<OsString, Hierarchy>,
|
||||
elems: FxHashSet<OsString>,
|
||||
children: RefCell<FxHashMap<OsString, Rc<Self>>>,
|
||||
elems: RefCell<FxHashSet<OsString>>,
|
||||
}
|
||||
|
||||
impl Hierarchy {
|
||||
fn new(elem: OsString) -> Hierarchy {
|
||||
Hierarchy { elem, children: FxHashMap::default(), elems: FxHashSet::default() }
|
||||
fn with_parent(elem: OsString, parent: &Rc<Self>) -> Self {
|
||||
Self { elem, parent: Rc::downgrade(parent), ..Self::default() }
|
||||
}
|
||||
|
||||
fn to_json_string(&self) -> String {
|
||||
let mut subs: Vec<&Hierarchy> = self.children.values().collect();
|
||||
let borrow = self.children.borrow();
|
||||
let mut subs: Vec<_> = borrow.values().collect();
|
||||
subs.sort_unstable_by(|a, b| a.elem.cmp(&b.elem));
|
||||
let mut files = self
|
||||
.elems
|
||||
.borrow()
|
||||
.iter()
|
||||
.map(|s| format!("\"{}\"", s.to_str().expect("invalid osstring conversion")))
|
||||
.collect::<Vec<_>>();
|
||||
|
|
@ -220,36 +224,52 @@ pub(super) fn write_shared(
|
|||
files = files
|
||||
)
|
||||
}
|
||||
|
||||
fn add_path(self: &Rc<Self>, path: &Path) {
|
||||
let mut h = Rc::clone(&self);
|
||||
let mut elems = path
|
||||
.components()
|
||||
.filter_map(|s| match s {
|
||||
Component::Normal(s) => Some(s.to_owned()),
|
||||
Component::ParentDir => Some(OsString::from("..")),
|
||||
_ => None,
|
||||
})
|
||||
.peekable();
|
||||
loop {
|
||||
let cur_elem = elems.next().expect("empty file path");
|
||||
if cur_elem == ".." {
|
||||
if let Some(parent) = h.parent.upgrade() {
|
||||
h = parent;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if elems.peek().is_none() {
|
||||
h.elems.borrow_mut().insert(cur_elem);
|
||||
break;
|
||||
} else {
|
||||
let entry = Rc::clone(
|
||||
h.children
|
||||
.borrow_mut()
|
||||
.entry(cur_elem.clone())
|
||||
.or_insert_with(|| Rc::new(Self::with_parent(cur_elem, &h))),
|
||||
);
|
||||
h = entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if cx.include_sources {
|
||||
let mut hierarchy = Hierarchy::new(OsString::new());
|
||||
let hierarchy = Rc::new(Hierarchy::default());
|
||||
for source in cx
|
||||
.shared
|
||||
.local_sources
|
||||
.iter()
|
||||
.filter_map(|p| p.0.strip_prefix(&cx.shared.src_root).ok())
|
||||
{
|
||||
let mut h = &mut hierarchy;
|
||||
let mut elems = source
|
||||
.components()
|
||||
.filter_map(|s| match s {
|
||||
Component::Normal(s) => Some(s.to_owned()),
|
||||
_ => None,
|
||||
})
|
||||
.peekable();
|
||||
loop {
|
||||
let cur_elem = elems.next().expect("empty file path");
|
||||
if elems.peek().is_none() {
|
||||
h.elems.insert(cur_elem);
|
||||
break;
|
||||
} else {
|
||||
let e = cur_elem.clone();
|
||||
h = h.children.entry(cur_elem.clone()).or_insert_with(|| Hierarchy::new(e));
|
||||
}
|
||||
}
|
||||
hierarchy.add_path(source);
|
||||
}
|
||||
|
||||
let hierarchy = Rc::try_unwrap(hierarchy).unwrap();
|
||||
let dst = cx.dst.join(&format!("source-files{}.js", cx.shared.resource_suffix));
|
||||
let make_sources = || {
|
||||
let (mut all_sources, _krates) =
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ use rustc_middle::ty::TyCtxt;
|
|||
use rustc_session::Session;
|
||||
use rustc_span::source_map::FileName;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::ffi::OsStr;
|
||||
use std::fs;
|
||||
use std::path::{Component, Path, PathBuf};
|
||||
|
|
@ -72,12 +73,22 @@ impl LocalSourcesCollector<'_, '_> {
|
|||
return;
|
||||
}
|
||||
|
||||
let mut href = String::new();
|
||||
clean_path(self.src_root, &p, false, |component| {
|
||||
href.push_str(&component.to_string_lossy());
|
||||
href.push('/');
|
||||
});
|
||||
let href = RefCell::new(PathBuf::new());
|
||||
clean_path(
|
||||
&self.src_root,
|
||||
&p,
|
||||
|component| {
|
||||
href.borrow_mut().push(component);
|
||||
},
|
||||
|| {
|
||||
href.borrow_mut().pop();
|
||||
},
|
||||
);
|
||||
|
||||
let mut href = href.into_inner().to_string_lossy().to_string();
|
||||
if let Some(c) = href.as_bytes().last() && *c != b'/' {
|
||||
href.push('/');
|
||||
}
|
||||
let mut src_fname = p.file_name().expect("source has no filename").to_os_string();
|
||||
src_fname.push(".html");
|
||||
href.push_str(&src_fname.to_string_lossy());
|
||||
|
|
@ -180,13 +191,28 @@ impl SourceCollector<'_, '_> {
|
|||
|
||||
let shared = Rc::clone(&self.cx.shared);
|
||||
// Create the intermediate directories
|
||||
let mut cur = self.dst.clone();
|
||||
let mut root_path = String::from("../../");
|
||||
clean_path(&shared.src_root, &p, false, |component| {
|
||||
cur.push(component);
|
||||
root_path.push_str("../");
|
||||
});
|
||||
let cur = RefCell::new(PathBuf::new());
|
||||
let root_path = RefCell::new(PathBuf::new());
|
||||
|
||||
clean_path(
|
||||
&shared.src_root,
|
||||
&p,
|
||||
|component| {
|
||||
cur.borrow_mut().push(component);
|
||||
root_path.borrow_mut().push("..");
|
||||
},
|
||||
|| {
|
||||
cur.borrow_mut().pop();
|
||||
root_path.borrow_mut().pop();
|
||||
},
|
||||
);
|
||||
|
||||
let root_path = PathBuf::from("../../").join(root_path.into_inner());
|
||||
let mut root_path = root_path.to_string_lossy();
|
||||
if let Some(c) = root_path.as_bytes().last() && *c != b'/' {
|
||||
root_path += "/";
|
||||
}
|
||||
let mut cur = self.dst.join(cur.into_inner());
|
||||
shared.ensure_dir(&cur)?;
|
||||
|
||||
let src_fname = p.file_name().expect("source has no filename").to_os_string();
|
||||
|
|
@ -232,11 +258,13 @@ impl SourceCollector<'_, '_> {
|
|||
/// Takes a path to a source file and cleans the path to it. This canonicalizes
|
||||
/// things like ".." to components which preserve the "top down" hierarchy of a
|
||||
/// static HTML tree. Each component in the cleaned path will be passed as an
|
||||
/// argument to `f`. The very last component of the path (ie the file name) will
|
||||
/// be passed to `f` if `keep_filename` is true, and ignored otherwise.
|
||||
pub(crate) fn clean_path<F>(src_root: &Path, p: &Path, keep_filename: bool, mut f: F)
|
||||
/// argument to `f`. The very last component of the path (ie the file name) is ignored.
|
||||
/// If a `..` is encountered, the `parent` closure will be called to allow the callee to
|
||||
/// handle it.
|
||||
pub(crate) fn clean_path<F, P>(src_root: &Path, p: &Path, mut f: F, mut parent: P)
|
||||
where
|
||||
F: FnMut(&OsStr),
|
||||
P: FnMut(),
|
||||
{
|
||||
// make it relative, if possible
|
||||
let p = p.strip_prefix(src_root).unwrap_or(p);
|
||||
|
|
@ -244,12 +272,12 @@ where
|
|||
let mut iter = p.components().peekable();
|
||||
|
||||
while let Some(c) = iter.next() {
|
||||
if !keep_filename && iter.peek().is_none() {
|
||||
if iter.peek().is_none() {
|
||||
break;
|
||||
}
|
||||
|
||||
match c {
|
||||
Component::ParentDir => f("up".as_ref()),
|
||||
Component::ParentDir => parent(),
|
||||
Component::Normal(c) => f(c),
|
||||
_ => continue,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,8 +76,6 @@
|
|||
}
|
||||
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
|
@ -110,11 +108,7 @@ body {
|
|||
/* Then override it with `anywhere`, which is required to make non-Safari browsers break
|
||||
more aggressively when we want them to. */
|
||||
overflow-wrap: anywhere;
|
||||
|
||||
-webkit-font-feature-settings: "kern", "liga";
|
||||
-moz-font-feature-settings: "kern", "liga";
|
||||
font-feature-settings: "kern", "liga";
|
||||
|
||||
background-color: var(--main-background-color);
|
||||
color: var(--main-color);
|
||||
}
|
||||
|
|
@ -358,6 +352,7 @@ img {
|
|||
.sub-logo-container, .logo-container {
|
||||
/* zero text boxes so that computed line height = image height exactly */
|
||||
line-height: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sub-logo-container {
|
||||
|
|
@ -501,7 +496,7 @@ ul.block, .block li {
|
|||
color: var(--sidebar-link-color);
|
||||
}
|
||||
.sidebar .current,
|
||||
.sidebar a:hover {
|
||||
.sidebar a:hover:not(.logo-container) {
|
||||
background-color: var(--sidebar-current-link-background-color);
|
||||
}
|
||||
|
||||
|
|
@ -543,8 +538,6 @@ ul.block, .block li {
|
|||
overflow: initial;
|
||||
text-align: right;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
padding: 14px 8px;
|
||||
color: var(--src-line-numbers-span-color);
|
||||
|
|
@ -1374,7 +1367,7 @@ kbd {
|
|||
vertical-align: middle;
|
||||
border: solid 1px var(--border-color);
|
||||
border-radius: 3px;
|
||||
color: var(--kbd--color);
|
||||
color: var(--kbd-color);
|
||||
background-color: var(--kbd-background);
|
||||
box-shadow: inset 0 -1px 0 var(--kbd-box-shadow-color);
|
||||
}
|
||||
|
|
@ -1576,7 +1569,7 @@ in storage.js
|
|||
|
||||
/* Hide the logo and item name from the sidebar. Those are displayed
|
||||
in the mobile-topbar instead. */
|
||||
.sidebar .sidebar-logo,
|
||||
.sidebar .logo-container,
|
||||
.sidebar .location {
|
||||
display: none;
|
||||
}
|
||||
|
|
@ -1605,14 +1598,10 @@ in storage.js
|
|||
|
||||
.sidebar.shown,
|
||||
.source-sidebar-expanded .source .sidebar,
|
||||
.sidebar:focus-within {
|
||||
.rustdoc:not(.source) .sidebar:focus-within {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.rustdoc.source > .sidebar {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.mobile-topbar h2 {
|
||||
padding-bottom: 0;
|
||||
margin: auto 0.5em auto auto;
|
||||
|
|
@ -1662,10 +1651,6 @@ in storage.js
|
|||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.anchor {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -563,7 +563,7 @@ function loadCss(cssUrl) {
|
|||
onEachLazy(code.getElementsByTagName("a"), elem => {
|
||||
const href = elem.getAttribute("href");
|
||||
|
||||
if (href && href.indexOf("http") !== 0) {
|
||||
if (href && !/^(?:[a-z+]+:)?\/\//.test(href)) {
|
||||
elem.setAttribute("href", window.rootPath + href);
|
||||
}
|
||||
});
|
||||
|
|
@ -1040,9 +1040,6 @@ function loadCss(cssUrl) {
|
|||
help_button.appendChild(container);
|
||||
|
||||
container.onblur = helpBlurHandler;
|
||||
container.onclick = event => {
|
||||
event.preventDefault();
|
||||
};
|
||||
help_button.onblur = helpBlurHandler;
|
||||
help_button.children[0].onblur = helpBlurHandler;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,28 +72,24 @@
|
|||
{%- if page.css_class != "source" -%}
|
||||
<nav class="mobile-topbar"> {#- -#}
|
||||
<button class="sidebar-menu-toggle">☰</button> {#- -#}
|
||||
<a class="sidebar-logo" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
|
||||
<div class="logo-container"> {#- -#}
|
||||
{%- if !layout.logo.is_empty() -%}
|
||||
<img src="{{layout.logo}}" alt="logo"> {#- -#}
|
||||
{%- else -%}
|
||||
<img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo"> {#- -#}
|
||||
{%- endif -%}
|
||||
</div> {#- -#}
|
||||
<a class="logo-container" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
|
||||
{%- if !layout.logo.is_empty() -%}
|
||||
<img src="{{layout.logo}}" alt="logo"> {#- -#}
|
||||
{%- else -%}
|
||||
<img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo"> {#- -#}
|
||||
{%- endif -%}
|
||||
</a> {#- -#}
|
||||
<h2></h2> {#- -#}
|
||||
</nav> {#- -#}
|
||||
{%- endif -%}
|
||||
<nav class="sidebar"> {#- -#}
|
||||
{%- if page.css_class != "source" -%}
|
||||
<a class="sidebar-logo" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
|
||||
<div class="logo-container"> {#- -#}
|
||||
{%- if !layout.logo.is_empty() %}
|
||||
<img src="{{layout.logo}}" alt="logo"> {#- -#}
|
||||
{%- else -%}
|
||||
<img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo"> {#- -#}
|
||||
{%- endif -%}
|
||||
</div> {#- -#}
|
||||
<a class="logo-container" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
|
||||
{%- if !layout.logo.is_empty() %}
|
||||
<img src="{{layout.logo}}" alt="logo"> {#- -#}
|
||||
{%- else -%}
|
||||
<img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo"> {#- -#}
|
||||
{%- endif -%}
|
||||
</a> {#- -#}
|
||||
{%- endif -%}
|
||||
{{- sidebar|safe -}}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@ use std::convert::From;
|
|||
use std::fmt;
|
||||
|
||||
use rustc_ast::ast;
|
||||
use rustc_hir::{def::CtorKind, def_id::DefId};
|
||||
use rustc_hir::{def::CtorKind, def::DefKind, def_id::DefId};
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{Pos, Symbol};
|
||||
use rustc_target::spec::abi::Abi as RustcAbi;
|
||||
|
||||
|
|
@ -217,13 +218,27 @@ pub(crate) fn from_item_id_with_name(item_id: ItemId, tcx: TyCtxt<'_>, name: Opt
|
|||
|
||||
impl<'a> fmt::Display for DisplayDefId<'a> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let name = match self.2 {
|
||||
let DisplayDefId(def_id, tcx, name) = self;
|
||||
let name = match name {
|
||||
Some(name) => format!(":{}", name.as_u32()),
|
||||
None => self
|
||||
.1
|
||||
.opt_item_name(self.0)
|
||||
.map(|n| format!(":{}", n.as_u32()))
|
||||
.unwrap_or_default(),
|
||||
None => {
|
||||
// We need this workaround because primitive types' DefId actually refers to
|
||||
// their parent module, which isn't present in the output JSON items. So
|
||||
// instead, we directly get the primitive symbol and convert it to u32 to
|
||||
// generate the ID.
|
||||
if matches!(tcx.def_kind(def_id), DefKind::Mod) &&
|
||||
let Some(prim) = tcx.get_attrs(*def_id, sym::doc)
|
||||
.flat_map(|attr| attr.meta_item_list().unwrap_or_default())
|
||||
.filter(|attr| attr.has_name(sym::primitive))
|
||||
.find_map(|attr| attr.value_str()) {
|
||||
format!(":{}", prim.as_u32())
|
||||
} else {
|
||||
tcx
|
||||
.opt_item_name(*def_id)
|
||||
.map(|n| format!(":{}", n.as_u32()))
|
||||
.unwrap_or_default()
|
||||
}
|
||||
}
|
||||
};
|
||||
write!(f, "{}:{}{}", self.0.krate.as_u32(), u32::from(self.0.index), name)
|
||||
}
|
||||
|
|
@ -237,7 +252,7 @@ pub(crate) fn from_item_id_with_name(item_id: ItemId, tcx: TyCtxt<'_>, name: Opt
|
|||
ItemId::Auto { for_, trait_ } => {
|
||||
Id(format!("a:{}-{}", DisplayDefId(trait_, tcx, None), DisplayDefId(for_, tcx, name)))
|
||||
}
|
||||
ItemId::Primitive(ty, krate) => Id(format!("p:{}:{}", krate.as_u32(), ty.as_sym())),
|
||||
ItemId::Primitive(_, _) => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ pub(crate) fn should_have_doc_example(cx: &DocContext<'_>, item: &clean::Item) -
|
|||
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(item.item_id.expect_def_id().expect_local());
|
||||
|
||||
// check if parent is trait impl
|
||||
if let Some(parent_hir_id) = cx.tcx.hir().find_parent_node(hir_id) {
|
||||
if let Some(parent_hir_id) = cx.tcx.hir().opt_parent_id(hir_id) {
|
||||
if let Some(parent_node) = cx.tcx.hir().find(parent_hir_id) {
|
||||
if matches!(
|
||||
parent_node,
|
||||
|
|
|
|||
|
|
@ -248,6 +248,7 @@ pub(crate) struct ImportStripper<'tcx> {
|
|||
impl<'tcx> DocFolder for ImportStripper<'tcx> {
|
||||
fn fold_item(&mut self, i: Item) -> Option<Item> {
|
||||
match *i.kind {
|
||||
clean::ImportItem(imp) if imp.imported_item_is_doc_hidden(self.tcx) => None,
|
||||
clean::ExternCrateItem { .. } | clean::ImportItem(..)
|
||||
if i.visibility(self.tcx) != Some(Visibility::Public) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
|||
|
||||
/// This method will create a new module and push it onto the "modules stack" then call
|
||||
/// `visit_mod_contents`. Once done, it'll remove it from the "modules stack" and instead
|
||||
/// add into into the list of modules of the current module.
|
||||
/// add into the list of modules of the current module.
|
||||
fn enter_mod(&mut self, id: hir::HirId, m: &'tcx hir::Mod<'tcx>, name: Symbol) {
|
||||
self.modules.push(Module::new(name, id, m.spans.inner_span));
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
// [r9] needs-llvm-components: aarch64
|
||||
// [r10] compile-flags: --target aarch64-apple-ios
|
||||
// [r10] needs-llvm-components: aarch64
|
||||
// [r11] compile-flags: --target aarch64-fuchsia
|
||||
// [r11] compile-flags: --target aarch64-unknown-fuchsia
|
||||
// [r11] needs-llvm-components: aarch64
|
||||
// [r12] compile-flags: --target aarch64-linux-android
|
||||
// [r12] needs-llvm-components: aarch64
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
// [r74] needs-llvm-components: x86
|
||||
// [r75] compile-flags:--target x86_64-fortanix-unknown-sgx
|
||||
// [r75] needs-llvm-components: x86
|
||||
// [r76] compile-flags:--target x86_64-fuchsia
|
||||
// [r76] compile-flags:--target x86_64-unknown-fuchsia
|
||||
// [r76] needs-llvm-components: x86
|
||||
// [r77] compile-flags:--target x86_64-linux-android
|
||||
// [r77] needs-llvm-components: x86
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// Once we're done with llvm 14 and earlier, this test can be deleted.
|
||||
|
||||
#![crate_type="lib"]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
use std::mem::MaybeUninit;
|
||||
|
||||
|
|
@ -17,8 +17,16 @@ pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
|
|||
Box::new(MaybeUninit::uninit())
|
||||
}
|
||||
|
||||
// FIXME: add a test for a bigger box. Currently broken, see
|
||||
// https://github.com/rust-lang/rust/issues/58201.
|
||||
// https://github.com/rust-lang/rust/issues/58201
|
||||
#[no_mangle]
|
||||
pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> {
|
||||
// CHECK-LABEL: @box_uninitialized2
|
||||
// CHECK-NOT: store
|
||||
// CHECK-NOT: alloca
|
||||
// CHECK-NOT: memcpy
|
||||
// CHECK-NOT: memset
|
||||
Box::new(MaybeUninit::uninit())
|
||||
}
|
||||
|
||||
// Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc
|
||||
// from the CHECK-NOT above. We don't check the attributes here because we can't rely
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// compile-flags: -O
|
||||
// min-llvm-version: 15.0
|
||||
#![crate_type="lib"]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
use std::mem::MaybeUninit;
|
||||
|
||||
|
|
@ -15,8 +15,16 @@ pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
|
|||
Box::new(MaybeUninit::uninit())
|
||||
}
|
||||
|
||||
// FIXME: add a test for a bigger box. Currently broken, see
|
||||
// https://github.com/rust-lang/rust/issues/58201.
|
||||
// https://github.com/rust-lang/rust/issues/58201
|
||||
#[no_mangle]
|
||||
pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> {
|
||||
// CHECK-LABEL: @box_uninitialized2
|
||||
// CHECK-NOT: store
|
||||
// CHECK-NOT: alloca
|
||||
// CHECK-NOT: memcpy
|
||||
// CHECK-NOT: memset
|
||||
Box::new(MaybeUninit::uninit())
|
||||
}
|
||||
|
||||
// Hide the `allocalign` attribute in the declaration of __rust_alloc
|
||||
// from the CHECK-NOT above, and also verify the attributes got set reasonably.
|
||||
|
|
|
|||
62
src/test/codegen/issue-86106.rs
Normal file
62
src/test/codegen/issue-86106.rs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
// min-llvm-version: 15.0
|
||||
// compile-flags: -C opt-level=3 -Z merge-functions=disabled
|
||||
|
||||
// The below two functions ensure that both `String::new()` and `"".to_string()`
|
||||
// produce the identical code.
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// CHECK-LABEL: define void @string_new
|
||||
#[no_mangle]
|
||||
pub fn string_new() -> String {
|
||||
// CHECK-NOT: load i8
|
||||
// CHECK: store i{{32|64}}
|
||||
// CHECK-NEXT: getelementptr
|
||||
// CHECK-NEXT: store ptr
|
||||
// CHECK-NEXT: getelementptr
|
||||
// CHECK-NEXT: store i{{32|64}}
|
||||
// CHECK-NEXT: ret void
|
||||
String::new()
|
||||
}
|
||||
|
||||
// CHECK-LABEL: define void @empty_to_string
|
||||
#[no_mangle]
|
||||
pub fn empty_to_string() -> String {
|
||||
// CHECK-NOT: load i8
|
||||
// CHECK: store i{{32|64}}
|
||||
// CHECK-NEXT: getelementptr
|
||||
// CHECK-NEXT: store ptr
|
||||
// CHECK-NEXT: getelementptr
|
||||
// CHECK-NEXT: store i{{32|64}}
|
||||
// CHECK-NEXT: ret void
|
||||
"".to_string()
|
||||
}
|
||||
|
||||
// The below two functions ensure that both `vec![]` and `vec![].clone()`
|
||||
// produce the identical code.
|
||||
|
||||
// CHECK-LABEL: @empty_vec
|
||||
#[no_mangle]
|
||||
pub fn empty_vec() -> Vec<u8> {
|
||||
// CHECK: store i{{32|64}}
|
||||
// CHECK-NOT: load i8
|
||||
// CHECK-NEXT: getelementptr
|
||||
// CHECK-NEXT: store ptr
|
||||
// CHECK-NEXT: getelementptr
|
||||
// CHECK-NEXT: store i{{32|64}}
|
||||
// CHECK-NEXT: ret void
|
||||
vec![]
|
||||
}
|
||||
|
||||
// CHECK-LABEL: @empty_vec_clone
|
||||
#[no_mangle]
|
||||
pub fn empty_vec_clone() -> Vec<u8> {
|
||||
// CHECK: store i{{32|64}}
|
||||
// CHECK-NOT: load i8
|
||||
// CHECK-NEXT: getelementptr
|
||||
// CHECK-NEXT: store ptr
|
||||
// CHECK-NEXT: getelementptr
|
||||
// CHECK-NEXT: store i{{32|64}}
|
||||
// CHECK-NEXT: ret void
|
||||
vec![].clone()
|
||||
}
|
||||
23
src/test/codegen/noalias-flag.rs
Normal file
23
src/test/codegen/noalias-flag.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// compile-flags: -O -Zmutable-noalias=no
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// `-Zmutable-noalias=no` should disable noalias on mut refs...
|
||||
|
||||
// CHECK-LABEL: @test_mut_ref(
|
||||
// CHECK-NOT: noalias
|
||||
// CHECK-SAME: %x
|
||||
#[no_mangle]
|
||||
pub fn test_mut_ref(x: &mut i32) -> &mut i32 {
|
||||
x
|
||||
}
|
||||
|
||||
// ...but not on shared refs
|
||||
|
||||
// CHECK-LABEL: @test_ref(
|
||||
// CHECK-SAME: noalias
|
||||
// CHECK-SAME: %x
|
||||
#[no_mangle]
|
||||
pub fn test_ref(x: &i32) -> &i32 {
|
||||
x
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ pub fn helper(_: usize) {
|
|||
pub fn scalar_layout(s: &(u64, ())) {
|
||||
// CHECK: getelementptr i8, {{.+}}, [[USIZE]] 8
|
||||
let x = &s.1;
|
||||
&x; // keep variable in an alloca
|
||||
witness(&x); // keep variable in an alloca
|
||||
}
|
||||
|
||||
// Check that we correctly generate a GEP for a ZST that is not included in ScalarPair layout
|
||||
|
|
@ -24,7 +24,7 @@ pub fn scalar_layout(s: &(u64, ())) {
|
|||
pub fn scalarpair_layout(s: &(u64, u32, ())) {
|
||||
// CHECK: getelementptr i8, {{.+}}, [[USIZE]] 12
|
||||
let x = &s.2;
|
||||
&x; // keep variable in an alloca
|
||||
witness(&x); // keep variable in an alloca
|
||||
}
|
||||
|
||||
#[repr(simd)]
|
||||
|
|
@ -36,5 +36,8 @@ pub struct U64x4(u64, u64, u64, u64);
|
|||
pub fn vector_layout(s: &(U64x4, ())) {
|
||||
// CHECK: getelementptr i8, {{.+}}, [[USIZE]] 32
|
||||
let x = &s.1;
|
||||
&x; // keep variable in an alloca
|
||||
witness(&x); // keep variable in an alloca
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn witness(_: &impl Sized) {}
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ pub fn add_parameter() {
|
|||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_parameter() {
|
||||
let x = 0u32;
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ fn main() -> () {
|
|||
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
|
||||
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
|
||||
// mir::Constant
|
||||
// + span: $DIR/const_allocation.rs:8:5: 8:8
|
||||
// + span: $DIR/const_allocation.rs:9:5: 9:8
|
||||
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
|
||||
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
|
||||
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
|
||||
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
|
||||
nop; // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
|
||||
_0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ fn main() -> () {
|
|||
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
|
||||
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
|
||||
// mir::Constant
|
||||
// + span: $DIR/const_allocation.rs:8:5: 8:8
|
||||
// + span: $DIR/const_allocation.rs:9:5: 9:8
|
||||
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
|
||||
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
|
||||
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
|
||||
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
|
||||
nop; // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
|
||||
_0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// unit-test: ConstProp
|
||||
// ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
static FOO: &[(Option<i32>, &[&str])] =
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ fn main() -> () {
|
|||
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
|
||||
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
|
||||
// mir::Constant
|
||||
// + span: $DIR/const_allocation2.rs:5:5: 5:8
|
||||
// + span: $DIR/const_allocation2.rs:6:5: 6:8
|
||||
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
|
||||
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
|
||||
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
|
||||
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
|
||||
nop; // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
|
||||
_0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ fn main() -> () {
|
|||
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
|
||||
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
|
||||
// mir::Constant
|
||||
// + span: $DIR/const_allocation2.rs:5:5: 5:8
|
||||
// + span: $DIR/const_allocation2.rs:6:5: 6:8
|
||||
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
|
||||
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
|
||||
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
|
||||
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
|
||||
nop; // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
|
||||
_0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// unit-test: ConstProp
|
||||
// ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
// EMIT_MIR const_allocation2.main.ConstProp.after.mir
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ fn main() -> () {
|
|||
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
|
||||
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
|
||||
// mir::Constant
|
||||
// + span: $DIR/const_allocation3.rs:5:5: 5:8
|
||||
// + span: $DIR/const_allocation3.rs:6:5: 6:8
|
||||
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
|
||||
_1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
|
||||
StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
|
||||
StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
|
||||
nop; // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
|
||||
_0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ fn main() -> () {
|
|||
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
|
||||
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
|
||||
// mir::Constant
|
||||
// + span: $DIR/const_allocation3.rs:5:5: 5:8
|
||||
// + span: $DIR/const_allocation3.rs:6:5: 6:8
|
||||
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
|
||||
_1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
|
||||
StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
|
||||
StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
|
||||
nop; // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
|
||||
_0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// unit-test: ConstProp
|
||||
// ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
// EMIT_MIR const_allocation3.main.ConstProp.after.mir
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
let mut _6: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:15: +4:16
|
||||
let mut _7: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:19: +4:20
|
||||
let mut _8: u8; // in scope 0 at $DIR/const_debuginfo.rs:+4:23: +4:24
|
||||
let mut _14: u32; // in scope 0 at $DIR/const_debuginfo.rs:+13:13: +13:16
|
||||
let mut _15: u32; // in scope 0 at $DIR/const_debuginfo.rs:+13:19: +13:22
|
||||
let mut _12: u32; // in scope 0 at $DIR/const_debuginfo.rs:+13:13: +13:16
|
||||
let mut _13: u32; // in scope 0 at $DIR/const_debuginfo.rs:+13:19: +13:22
|
||||
scope 1 {
|
||||
- debug x => _1; // in scope 1 at $DIR/const_debuginfo.rs:+1:9: +1:10
|
||||
+ debug x => const 1_u8; // in scope 1 at $DIR/const_debuginfo.rs:+1:9: +1:10
|
||||
|
|
@ -29,23 +29,21 @@
|
|||
scope 5 {
|
||||
- debug s => _9; // in scope 5 at $DIR/const_debuginfo.rs:+6:9: +6:10
|
||||
+ debug s => const "hello, world!"; // in scope 5 at $DIR/const_debuginfo.rs:+6:9: +6:10
|
||||
let _10: (bool, bool, u32); // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
let _16: bool; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
let _17: bool; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
let _18: u32; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
let _14: bool; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
let _15: bool; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
let _16: u32; // in scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
scope 6 {
|
||||
debug f => (bool, bool, u32){ .0 => _16, .1 => _17, .2 => _18, }; // in scope 6 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
let _11: std::option::Option<u16>; // in scope 6 at $DIR/const_debuginfo.rs:+10:9: +10:10
|
||||
debug f => (bool, bool, u32){ .0 => _14, .1 => _15, .2 => _16, }; // in scope 6 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
let _10: std::option::Option<u16>; // in scope 6 at $DIR/const_debuginfo.rs:+10:9: +10:10
|
||||
scope 7 {
|
||||
debug o => _11; // in scope 7 at $DIR/const_debuginfo.rs:+10:9: +10:10
|
||||
let _12: Point; // in scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
let _19: u32; // in scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
let _20: u32; // in scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
debug o => _10; // in scope 7 at $DIR/const_debuginfo.rs:+10:9: +10:10
|
||||
let _17: u32; // in scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
let _18: u32; // in scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
scope 8 {
|
||||
debug p => Point{ .0 => _19, .1 => _20, }; // in scope 8 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
let _13: u32; // in scope 8 at $DIR/const_debuginfo.rs:+13:9: +13:10
|
||||
debug p => Point{ .0 => _17, .1 => _18, }; // in scope 8 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
let _11: u32; // in scope 8 at $DIR/const_debuginfo.rs:+13:9: +13:10
|
||||
scope 9 {
|
||||
- debug a => _13; // in scope 9 at $DIR/const_debuginfo.rs:+13:9: +13:10
|
||||
- debug a => _11; // in scope 9 at $DIR/const_debuginfo.rs:+13:9: +13:10
|
||||
+ debug a => const 64_u32; // in scope 9 at $DIR/const_debuginfo.rs:+13:9: +13:10
|
||||
}
|
||||
}
|
||||
|
|
@ -83,41 +81,40 @@
|
|||
// mir::Constant
|
||||
// + span: $DIR/const_debuginfo.rs:14:13: 14:28
|
||||
// + literal: Const { ty: &str, val: Value(Slice(..)) }
|
||||
StorageLive(_14); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
StorageLive(_15); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
StorageLive(_16); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
StorageLive(_17); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
StorageLive(_18); // scope 5 at $DIR/const_debuginfo.rs:+8:9: +8:10
|
||||
Deinit(_14); // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
Deinit(_15); // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
Deinit(_16); // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
Deinit(_17); // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
Deinit(_18); // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
_16 = const true; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
_17 = const false; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
_18 = const 123_u32; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
StorageLive(_11); // scope 6 at $DIR/const_debuginfo.rs:+10:9: +10:10
|
||||
Deinit(_11); // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
|
||||
((_11 as Some).0: u16) = const 99_u16; // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
|
||||
discriminant(_11) = 1; // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
|
||||
StorageLive(_19); // scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
StorageLive(_20); // scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
Deinit(_19); // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
|
||||
Deinit(_20); // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
|
||||
_19 = const 32_u32; // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
|
||||
_20 = const 32_u32; // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
|
||||
StorageLive(_13); // scope 8 at $DIR/const_debuginfo.rs:+13:9: +13:10
|
||||
StorageLive(_14); // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:16
|
||||
_14 = const 32_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:16
|
||||
StorageLive(_15); // scope 8 at $DIR/const_debuginfo.rs:+13:19: +13:22
|
||||
_15 = const 32_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:19: +13:22
|
||||
_13 = const 64_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:22
|
||||
StorageDead(_15); // scope 8 at $DIR/const_debuginfo.rs:+13:21: +13:22
|
||||
StorageDead(_14); // scope 8 at $DIR/const_debuginfo.rs:+13:21: +13:22
|
||||
nop; // scope 0 at $DIR/const_debuginfo.rs:+0:11: +14:2
|
||||
StorageDead(_13); // scope 8 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_19); // scope 7 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_20); // scope 7 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_11); // scope 6 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
_14 = const true; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
_15 = const false; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
_16 = const 123_u32; // scope 5 at $DIR/const_debuginfo.rs:+8:13: +8:34
|
||||
StorageLive(_10); // scope 6 at $DIR/const_debuginfo.rs:+10:9: +10:10
|
||||
Deinit(_10); // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
|
||||
((_10 as Some).0: u16) = const 99_u16; // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
|
||||
discriminant(_10) = 1; // scope 6 at $DIR/const_debuginfo.rs:+10:13: +10:24
|
||||
StorageLive(_17); // scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
StorageLive(_18); // scope 7 at $DIR/const_debuginfo.rs:+12:9: +12:10
|
||||
Deinit(_17); // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
|
||||
Deinit(_18); // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
|
||||
_17 = const 32_u32; // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
|
||||
_18 = const 32_u32; // scope 7 at $DIR/const_debuginfo.rs:+12:13: +12:35
|
||||
StorageLive(_11); // scope 8 at $DIR/const_debuginfo.rs:+13:9: +13:10
|
||||
StorageLive(_12); // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:16
|
||||
_12 = const 32_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:16
|
||||
StorageLive(_13); // scope 8 at $DIR/const_debuginfo.rs:+13:19: +13:22
|
||||
_13 = const 32_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:19: +13:22
|
||||
_11 = const 64_u32; // scope 8 at $DIR/const_debuginfo.rs:+13:13: +13:22
|
||||
StorageDead(_13); // scope 8 at $DIR/const_debuginfo.rs:+13:21: +13:22
|
||||
StorageDead(_12); // scope 8 at $DIR/const_debuginfo.rs:+13:21: +13:22
|
||||
StorageDead(_11); // scope 8 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_17); // scope 7 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_18); // scope 7 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_10); // scope 6 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_14); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_15); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_16); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_17); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_18); // scope 5 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_9); // scope 4 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_4); // scope 3 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
StorageDead(_3); // scope 2 at $DIR/const_debuginfo.rs:+14:1: +14:2
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@
|
|||
- _2 = Rem(const 1_i32, move _3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
+ _2 = Rem(const 1_i32, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
|
||||
StorageDead(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
|
||||
nop; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+0:11: +3:2
|
||||
StorageDead(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:2: +3:2
|
||||
|
|
|
|||
|
|
@ -6,17 +6,16 @@
|
|||
let _1: *const [i32]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _4: [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:26: +1:35
|
||||
let _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
let mut _7: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _8: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _9: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _5: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
let mut _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _7: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _8: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
scope 1 {
|
||||
debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
scope 2 {
|
||||
let _5: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
let _4: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
scope 3 {
|
||||
debug _b => _5; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
debug _b => _4; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,30 +24,29 @@
|
|||
StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_8 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
// mir::Constant
|
||||
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
|
||||
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_3 = _8; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35
|
||||
StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:35: +1:36
|
||||
StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ _8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
StorageLive(_4); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_5 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_6 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- _7 = Lt(_5, _6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ _7 = Lt(const 3_usize, _6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
|
||||
nop; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
|
||||
StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
|
||||
_4 = (*_1)[_5]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
|
||||
StorageDead(_4); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
|
||||
StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2
|
||||
return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,17 +6,16 @@
|
|||
let _1: *const [i32]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
let mut _2: *const [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _3: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _4: [i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:26: +1:35
|
||||
let _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
let mut _7: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _8: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _9: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
let _5: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
let mut _6: usize; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _7: bool; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
let mut _8: &[i32; 3]; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
scope 1 {
|
||||
debug a => _1; // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
scope 2 {
|
||||
let _5: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
let _4: i32; // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
scope 3 {
|
||||
debug _b => _5; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
debug _b => _4; // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,30 +24,29 @@
|
|||
StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
|
||||
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_8 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
// mir::Constant
|
||||
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
|
||||
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_3 = _8; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
_1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
|
||||
StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35
|
||||
StorageDead(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:35: +1:36
|
||||
StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ _8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
StorageLive(_4); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:13: +3:15
|
||||
StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_5 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
|
||||
_6 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- _7 = Lt(_5, _6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ _7 = Lt(const 3_usize, _6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
+ assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
|
||||
nop; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
|
||||
StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
|
||||
_4 = (*_1)[_5]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
|
||||
StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
|
||||
StorageDead(_4); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
|
||||
StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2
|
||||
return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
}
|
||||
|
||||
bb2: {
|
||||
nop; // scope 0 at $DIR/control_flow_simplification.rs:+3:6: +3:6
|
||||
StorageDead(_1); // scope 0 at $DIR/control_flow_simplification.rs:+3:5: +3:6
|
||||
return; // scope 0 at $DIR/control_flow_simplification.rs:+4:2: +4:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@
|
|||
let mut _2: main::InvalidChar; // in scope 0 at $DIR/invalid_constant.rs:+6:34: +6:63
|
||||
let mut _4: E; // in scope 0 at $DIR/invalid_constant.rs:+13:25: +13:59
|
||||
let mut _5: main::InvalidTag; // in scope 0 at $DIR/invalid_constant.rs:+13:34: +13:55
|
||||
let mut _7: Empty; // in scope 0 at $DIR/invalid_constant.rs:+20:35: +20:73
|
||||
let mut _8: main::NoVariants; // in scope 0 at $DIR/invalid_constant.rs:+20:44: +20:65
|
||||
scope 1 {
|
||||
debug _invalid_char => _1; // in scope 1 at $DIR/invalid_constant.rs:+6:9: +6:22
|
||||
let _3: [E; 1]; // in scope 1 at $DIR/invalid_constant.rs:+13:9: +13:21
|
||||
|
|
@ -17,9 +15,9 @@
|
|||
let _6: [Empty; 1]; // in scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31
|
||||
scope 5 {
|
||||
debug _enum_without_variants => _6; // in scope 5 at $DIR/invalid_constant.rs:+20:9: +20:31
|
||||
let _9: main::Str<"<22><><EFBFBD>">; // in scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
|
||||
let _7: main::Str<"<22><><EFBFBD>">; // in scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
|
||||
scope 7 {
|
||||
debug _non_utf8_str => _9; // in scope 7 at $DIR/invalid_constant.rs:+24:9: +24:22
|
||||
debug _non_utf8_str => _7; // in scope 7 at $DIR/invalid_constant.rs:+24:9: +24:22
|
||||
}
|
||||
}
|
||||
scope 6 {
|
||||
|
|
@ -57,17 +55,8 @@
|
|||
StorageDead(_4); // scope 1 at $DIR/invalid_constant.rs:+13:59: +13:60
|
||||
StorageDead(_5); // scope 1 at $DIR/invalid_constant.rs:+13:60: +13:61
|
||||
StorageLive(_6); // scope 3 at $DIR/invalid_constant.rs:+20:9: +20:31
|
||||
StorageLive(_7); // scope 3 at $DIR/invalid_constant.rs:+20:35: +20:73
|
||||
StorageLive(_8); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65
|
||||
Deinit(_8); // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65
|
||||
(_8.0: u32) = const 0_u32; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:65
|
||||
nop; // scope 6 at $DIR/invalid_constant.rs:+20:44: +20:71
|
||||
nop; // scope 3 at $DIR/invalid_constant.rs:+20:34: +20:74
|
||||
StorageDead(_7); // scope 3 at $DIR/invalid_constant.rs:+20:73: +20:74
|
||||
StorageDead(_8); // scope 3 at $DIR/invalid_constant.rs:+20:74: +20:75
|
||||
StorageLive(_9); // scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
|
||||
nop; // scope 0 at $DIR/invalid_constant.rs:+0:11: +27:2
|
||||
StorageDead(_9); // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2
|
||||
StorageLive(_7); // scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
|
||||
StorageDead(_7); // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2
|
||||
StorageDead(_6); // scope 3 at $DIR/invalid_constant.rs:+27:1: +27:2
|
||||
StorageDead(_3); // scope 1 at $DIR/invalid_constant.rs:+27:1: +27:2
|
||||
StorageDead(_1); // scope 0 at $DIR/invalid_constant.rs:+27:1: +27:2
|
||||
|
|
|
|||
|
|
@ -5,18 +5,13 @@
|
|||
let mut _0: (); // return place in scope 0 at $DIR/issue_66971.rs:+0:11: +0:11
|
||||
let _1: (); // in scope 0 at $DIR/issue_66971.rs:+1:5: +1:23
|
||||
let mut _2: ((), u8, u8); // in scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
|
||||
let mut _3: (); // in scope 0 at $DIR/issue_66971.rs:+1:13: +1:15
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/issue_66971.rs:+1:5: +1:23
|
||||
StorageLive(_2); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
|
||||
StorageLive(_3); // scope 0 at $DIR/issue_66971.rs:+1:13: +1:15
|
||||
nop; // scope 0 at $DIR/issue_66971.rs:+1:13: +1:15
|
||||
Deinit(_2); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
|
||||
nop; // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
|
||||
(_2.1: u8) = const 0_u8; // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
|
||||
(_2.2: u8) = const 0_u8; // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
|
||||
StorageDead(_3); // scope 0 at $DIR/issue_66971.rs:+1:21: +1:22
|
||||
_1 = encode(move _2) -> bb1; // scope 0 at $DIR/issue_66971.rs:+1:5: +1:23
|
||||
// mir::Constant
|
||||
// + span: $DIR/issue_66971.rs:17:5: 17:11
|
||||
|
|
@ -26,7 +21,6 @@
|
|||
bb1: {
|
||||
StorageDead(_2); // scope 0 at $DIR/issue_66971.rs:+1:22: +1:23
|
||||
StorageDead(_1); // scope 0 at $DIR/issue_66971.rs:+1:23: +1:24
|
||||
nop; // scope 0 at $DIR/issue_66971.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/issue_66971.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
bb1: {
|
||||
StorageDead(_2); // scope 0 at $DIR/issue_67019.rs:+1:19: +1:20
|
||||
StorageDead(_1); // scope 0 at $DIR/issue_67019.rs:+1:20: +1:21
|
||||
nop; // scope 0 at $DIR/issue_67019.rs:+0:11: +2:2
|
||||
return; // scope 0 at $DIR/issue_67019.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
_1 = _2[_3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
StorageDead(_3); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
|
||||
StorageDead(_2); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
|
||||
nop; // scope 0 at $DIR/large_array_index.rs:+0:11: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/large_array_index.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/large_array_index.rs:+3:2: +3:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
_1 = _2[_3]; // scope 0 at $DIR/large_array_index.rs:+2:17: +2:32
|
||||
StorageDead(_3); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
|
||||
StorageDead(_2); // scope 0 at $DIR/large_array_index.rs:+2:32: +2:33
|
||||
nop; // scope 0 at $DIR/large_array_index.rs:+0:11: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/large_array_index.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/large_array_index.rs:+3:2: +3:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
StorageLive(_2); // scope 1 at $DIR/mutable_variable.rs:+3:9: +3:10
|
||||
- _2 = _1; // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14
|
||||
+ _2 = const 99_i32; // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14
|
||||
nop; // scope 0 at $DIR/mutable_variable.rs:+0:11: +4:2
|
||||
StorageDead(_2); // scope 1 at $DIR/mutable_variable.rs:+4:1: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/mutable_variable.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/mutable_variable.rs:+4:2: +4:2
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:9: +3:10
|
||||
- _2 = _1; // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:13: +3:14
|
||||
+ _2 = const (42_i32, 99_i32); // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:13: +3:14
|
||||
nop; // scope 0 at $DIR/mutable_variable_aggregate.rs:+0:11: +4:2
|
||||
StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate.rs:+4:1: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/mutable_variable_aggregate.rs:+4:2: +4:2
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
((*_2).1: i32) = const 99_i32; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+3:5: +3:13
|
||||
StorageLive(_3); // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:9: +4:10
|
||||
_3 = _1; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:13: +4:14
|
||||
nop; // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+0:11: +5:2
|
||||
StorageDead(_3); // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2
|
||||
StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2
|
||||
StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:9: +4:10
|
||||
- _2 = (_1.1: i32); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16
|
||||
+ _2 = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16
|
||||
nop; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+0:11: +5:2
|
||||
StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2
|
||||
StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2
|
||||
return; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:2: +5:2
|
||||
|
|
|
|||
|
|
@ -4,39 +4,34 @@
|
|||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_no_prop.rs:+0:11: +0:11
|
||||
let mut _1: u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+1:9: +1:14
|
||||
let _2: (); // in scope 0 at $DIR/mutable_variable_no_prop.rs:+2:5: +4:6
|
||||
let mut _3: u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
let mut _4: *mut u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
let mut _2: u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
let mut _3: *mut u32; // in scope 0 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/mutable_variable_no_prop.rs:+1:9: +1:14
|
||||
let _5: u32; // in scope 1 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
|
||||
let _4: u32; // in scope 1 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
|
||||
scope 2 {
|
||||
}
|
||||
scope 3 {
|
||||
debug y => _5; // in scope 3 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
|
||||
debug y => _4; // in scope 3 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/mutable_variable_no_prop.rs:+1:9: +1:14
|
||||
_1 = const 42_u32; // scope 0 at $DIR/mutable_variable_no_prop.rs:+1:17: +1:19
|
||||
StorageLive(_2); // scope 1 at $DIR/mutable_variable_no_prop.rs:+2:5: +4:6
|
||||
StorageLive(_2); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
StorageLive(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
StorageLive(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
_4 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
_3 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
// mir::Constant
|
||||
// + span: $DIR/mutable_variable_no_prop.rs:10:13: 10:19
|
||||
// + literal: Const { ty: *mut u32, val: Value(Scalar(alloc1)) }
|
||||
_3 = (*_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
_1 = move _3; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:9: +3:19
|
||||
StorageDead(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:18: +3:19
|
||||
StorageDead(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:19: +3:20
|
||||
nop; // scope 2 at $DIR/mutable_variable_no_prop.rs:+2:5: +4:6
|
||||
StorageDead(_2); // scope 1 at $DIR/mutable_variable_no_prop.rs:+4:5: +4:6
|
||||
StorageLive(_5); // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
|
||||
_5 = _1; // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:13: +5:14
|
||||
nop; // scope 0 at $DIR/mutable_variable_no_prop.rs:+0:11: +6:2
|
||||
StorageDead(_5); // scope 1 at $DIR/mutable_variable_no_prop.rs:+6:1: +6:2
|
||||
_2 = (*_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
|
||||
_1 = move _2; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:9: +3:19
|
||||
StorageDead(_2); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:18: +3:19
|
||||
StorageDead(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:19: +3:20
|
||||
StorageLive(_4); // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
|
||||
_4 = _1; // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:13: +5:14
|
||||
StorageDead(_4); // scope 1 at $DIR/mutable_variable_no_prop.rs:+6:1: +6:2
|
||||
StorageDead(_1); // scope 0 at $DIR/mutable_variable_no_prop.rs:+6:1: +6:2
|
||||
return; // scope 0 at $DIR/mutable_variable_no_prop.rs:+6:2: +6:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,20 +4,19 @@
|
|||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +0:11
|
||||
let _1: i32; // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10
|
||||
let mut _3: i32; // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
let mut _2: i32; // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
scope 1 {
|
||||
debug a => _1; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10
|
||||
let mut _2: (i32, i32); // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
let mut _5: i32; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
let mut _6: i32; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
let mut _7: i32; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
scope 2 {
|
||||
debug x => (i32, i32){ .0 => _6, .1 => _7, }; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
let _4: i32; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
|
||||
debug x => (i32, i32){ .0 => _5, .1 => _6, }; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
let _3: i32; // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
|
||||
scope 3 {
|
||||
debug y => _4; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
|
||||
let _5: i32; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
|
||||
debug y => _3; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
|
||||
let _4: i32; // in scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
|
||||
scope 4 {
|
||||
debug z => _5; // in scope 4 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
|
||||
debug z => _4; // in scope 4 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -32,26 +31,25 @@
|
|||
}
|
||||
|
||||
bb1: {
|
||||
StorageLive(_5); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
StorageLive(_6); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
StorageLive(_7); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:9: +2:14
|
||||
Deinit(_5); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
|
||||
Deinit(_6); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
|
||||
Deinit(_7); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
|
||||
_6 = const 1_i32; // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
|
||||
_7 = const 2_i32; // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
|
||||
StorageLive(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
_3 = _1; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
_7 = move _3; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:5: +3:12
|
||||
StorageDead(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
StorageLive(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
|
||||
_4 = _7; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:13: +4:16
|
||||
StorageLive(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
|
||||
- _5 = _6; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
|
||||
+ _5 = const 1_i32; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
|
||||
nop; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +6:2
|
||||
StorageDead(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
StorageDead(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
_5 = const 1_i32; // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
|
||||
_6 = const 2_i32; // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+2:29: +2:35
|
||||
StorageLive(_2); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
_2 = _1; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
_6 = move _2; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:5: +3:12
|
||||
StorageDead(_2); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+3:11: +3:12
|
||||
StorageLive(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
|
||||
_3 = _6; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:13: +4:16
|
||||
StorageLive(_4); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
|
||||
- _4 = _5; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
|
||||
+ _4 = const 1_i32; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
|
||||
StorageDead(_4); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
StorageDead(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
StorageDead(_5); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
StorageDead(_6); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
StorageDead(_7); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
StorageDead(_1); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
|
||||
return; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+6:2: +6:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@
|
|||
let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
|
||||
let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
|
||||
let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
|
||||
let mut _9: Point; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
let mut _10: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
let mut _11: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
let mut _9: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
|
||||
let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
|
||||
|
|
@ -53,17 +51,12 @@
|
|||
StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
|
||||
StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
|
||||
StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
|
||||
StorageLive(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
StorageLive(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
Deinit(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
Deinit(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
_10 = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
_11 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
- _8 = _11; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
|
||||
StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
Deinit(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
_9 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
- _8 = _9; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
|
||||
+ _8 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
|
||||
StorageDead(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
|
||||
StorageDead(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
|
||||
nop; // scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +4:2
|
||||
StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
|
||||
StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
|
||||
StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@
|
|||
let _5: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:32: +2:33
|
||||
let mut _6: usize; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
|
||||
let mut _7: bool; // in scope 0 at $DIR/optimizes_into_variable.rs:+2:13: +2:34
|
||||
let mut _9: Point; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
let mut _10: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
let mut _11: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
let mut _9: u32; // in scope 0 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
scope 1 {
|
||||
debug x => _1; // in scope 1 at $DIR/optimizes_into_variable.rs:+1:9: +1:10
|
||||
let _3: i32; // in scope 1 at $DIR/optimizes_into_variable.rs:+2:9: +2:10
|
||||
|
|
@ -53,17 +51,12 @@
|
|||
StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
|
||||
StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:+2:34: +2:35
|
||||
StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+3:9: +3:10
|
||||
StorageLive(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
StorageLive(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
Deinit(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
Deinit(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
_10 = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
_11 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
- _8 = _11; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
|
||||
StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
Deinit(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
_9 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:36
|
||||
- _8 = _9; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
|
||||
+ _8 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:+3:13: +3:38
|
||||
StorageDead(_10); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
|
||||
StorageDead(_11); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
|
||||
nop; // scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +4:2
|
||||
StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:+3:38: +3:39
|
||||
StorageDead(_8); // scope 2 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
|
||||
StorageDead(_3); // scope 1 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/optimizes_into_variable.rs:+4:1: +4:2
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// MIR for `main` after SimplifyLocals
|
||||
// MIR for `main` after SimplifyLocals-final
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// MIR for `main` after SimplifyLocals
|
||||
// MIR for `main` after SimplifyLocals-final
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/optimizes_into_variable.rs:+0:11: +0:11
|
||||
|
|
@ -9,7 +9,7 @@ struct Point {
|
|||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
// EMIT_MIR optimizes_into_variable.main.ScalarReplacementOfAggregates.diff
|
||||
// EMIT_MIR optimizes_into_variable.main.ConstProp.diff
|
||||
// EMIT_MIR optimizes_into_variable.main.SimplifyLocals.after.mir
|
||||
// EMIT_MIR optimizes_into_variable.main.SimplifyLocals-final.after.mir
|
||||
// EMIT_MIR optimizes_into_variable.main.PreCodegen.after.mir
|
||||
fn main() {
|
||||
let x = 2 + 2;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
StorageDead(_2); // scope 0 at $DIR/read_immutable_static.rs:+1:21: +1:22
|
||||
StorageDead(_5); // scope 0 at $DIR/read_immutable_static.rs:+1:22: +1:23
|
||||
StorageDead(_3); // scope 0 at $DIR/read_immutable_static.rs:+1:22: +1:23
|
||||
nop; // scope 0 at $DIR/read_immutable_static.rs:+0:11: +2:2
|
||||
StorageDead(_1); // scope 0 at $DIR/read_immutable_static.rs:+2:1: +2:2
|
||||
return; // scope 0 at $DIR/read_immutable_static.rs:+2:2: +2:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
|
||||
_4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
|
||||
// mir::Constant
|
||||
// + span: $DIR/ref_deref.rs:5:6: 5:10
|
||||
// + span: $DIR/ref_deref.rs:6:6: 6:10
|
||||
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_2 = _4; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
|
||||
- _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
|
||||
+ _4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
|
||||
+ // mir::Constant
|
||||
+ // + span: $DIR/ref_deref.rs:5:6: 5:10
|
||||
+ // + span: $DIR/ref_deref.rs:6:6: 6:10
|
||||
+ // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
+ _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
|
||||
_1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
|
||||
// EMIT_MIR ref_deref.main.PromoteTemps.diff
|
||||
// EMIT_MIR ref_deref.main.ConstProp.diff
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// unit-test
|
||||
// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
|
||||
// EMIT_MIR ref_deref_project.main.PromoteTemps.diff
|
||||
// EMIT_MIR ref_deref_project.main.ConstProp.diff
|
||||
|
||||
|
|
|
|||
|
|
@ -3,26 +3,21 @@
|
|||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/reify_fn_ptr.rs:+0:11: +0:11
|
||||
let mut _1: *const fn(); // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:41
|
||||
let mut _2: usize; // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
|
||||
let mut _3: fn(); // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
|
||||
let mut _1: usize; // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
|
||||
let mut _2: fn(); // in scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
|
||||
scope 1 {
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:41
|
||||
StorageLive(_2); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
|
||||
StorageLive(_3); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
|
||||
_3 = main as fn() (Pointer(ReifyFnPointer)); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
|
||||
StorageLive(_1); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
|
||||
StorageLive(_2); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
|
||||
_2 = main as fn() (Pointer(ReifyFnPointer)); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
|
||||
// mir::Constant
|
||||
// + span: $DIR/reify_fn_ptr.rs:4:13: 4:17
|
||||
// + literal: Const { ty: fn() {main}, val: Value(<ZST>) }
|
||||
_2 = move _3 as usize (PointerExposeAddress); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
|
||||
StorageDead(_3); // scope 0 at $DIR/reify_fn_ptr.rs:+1:25: +1:26
|
||||
_1 = move _2 as *const fn() (PointerFromExposedAddress); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:41
|
||||
StorageDead(_2); // scope 0 at $DIR/reify_fn_ptr.rs:+1:40: +1:41
|
||||
StorageDead(_1); // scope 0 at $DIR/reify_fn_ptr.rs:+1:41: +1:42
|
||||
nop; // scope 0 at $DIR/reify_fn_ptr.rs:+0:11: +2:2
|
||||
_1 = move _2 as usize (PointerExposeAddress); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
|
||||
StorageDead(_2); // scope 0 at $DIR/reify_fn_ptr.rs:+1:25: +1:26
|
||||
StorageDead(_1); // scope 0 at $DIR/reify_fn_ptr.rs:+1:40: +1:41
|
||||
return; // scope 0 at $DIR/reify_fn_ptr.rs:+2:2: +2:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32
|
||||
StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
|
||||
StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
|
||||
nop; // scope 0 at $DIR/repeat.rs:+0:11: +2:2
|
||||
StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2
|
||||
return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32
|
||||
StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
|
||||
StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
|
||||
nop; // scope 0 at $DIR/repeat.rs:+0:11: +2:2
|
||||
StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2
|
||||
return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
bb1: {
|
||||
StorageDead(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:14: +2:15
|
||||
StorageDead(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:15: +2:16
|
||||
nop; // scope 0 at $DIR/scalar_literal_propagation.rs:+0:11: +3:2
|
||||
StorageDead(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:+3:1: +3:2
|
||||
return; // scope 0 at $DIR/scalar_literal_propagation.rs:+3:2: +3:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
// mir::Constant
|
||||
// + span: $DIR/slice_len.rs:5:6: 5:19
|
||||
// + span: $DIR/slice_len.rs:6:6: 6:19
|
||||
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
// mir::Constant
|
||||
// + span: $DIR/slice_len.rs:5:6: 5:19
|
||||
// + span: $DIR/slice_len.rs:6:6: 6:19
|
||||
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
// EMIT_MIR slice_len.main.ConstProp.diff
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
bb1: {
|
||||
StorageDead(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:14: +3:15
|
||||
StorageDead(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:15: +3:16
|
||||
nop; // scope 0 at $DIR/tuple_literal_propagation.rs:+0:11: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/tuple_literal_propagation.rs:+4:2: +4:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,16 +4,15 @@
|
|||
fn bar() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/const_prop_miscompile.rs:+0:10: +0:10
|
||||
let mut _1: (i32,); // in scope 0 at $DIR/const_prop_miscompile.rs:+1:9: +1:14
|
||||
let _2: (); // in scope 0 at $DIR/const_prop_miscompile.rs:+2:5: +4:6
|
||||
let mut _3: *mut i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+3:10: +3:22
|
||||
let mut _5: i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+5:13: +5:20
|
||||
let mut _2: *mut i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+3:10: +3:22
|
||||
let mut _4: i32; // in scope 0 at $DIR/const_prop_miscompile.rs:+5:13: +5:20
|
||||
scope 1 {
|
||||
debug v => _1; // in scope 1 at $DIR/const_prop_miscompile.rs:+1:9: +1:14
|
||||
let _4: bool; // in scope 1 at $DIR/const_prop_miscompile.rs:+5:9: +5:10
|
||||
let _3: bool; // in scope 1 at $DIR/const_prop_miscompile.rs:+5:9: +5:10
|
||||
scope 2 {
|
||||
}
|
||||
scope 3 {
|
||||
debug y => _4; // in scope 3 at $DIR/const_prop_miscompile.rs:+5:9: +5:10
|
||||
debug y => _3; // in scope 3 at $DIR/const_prop_miscompile.rs:+5:9: +5:10
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -21,20 +20,16 @@
|
|||
StorageLive(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+1:9: +1:14
|
||||
Deinit(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+1:17: +1:21
|
||||
(_1.0: i32) = const 1_i32; // scope 0 at $DIR/const_prop_miscompile.rs:+1:17: +1:21
|
||||
StorageLive(_2); // scope 1 at $DIR/const_prop_miscompile.rs:+2:5: +4:6
|
||||
StorageLive(_3); // scope 2 at $DIR/const_prop_miscompile.rs:+3:10: +3:22
|
||||
_3 = &raw mut (_1.0: i32); // scope 2 at $DIR/const_prop_miscompile.rs:+3:10: +3:22
|
||||
(*_3) = const 5_i32; // scope 2 at $DIR/const_prop_miscompile.rs:+3:9: +3:26
|
||||
StorageDead(_3); // scope 2 at $DIR/const_prop_miscompile.rs:+3:26: +3:27
|
||||
nop; // scope 2 at $DIR/const_prop_miscompile.rs:+2:5: +4:6
|
||||
StorageDead(_2); // scope 1 at $DIR/const_prop_miscompile.rs:+4:5: +4:6
|
||||
StorageLive(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+5:9: +5:10
|
||||
StorageLive(_5); // scope 1 at $DIR/const_prop_miscompile.rs:+5:13: +5:20
|
||||
_5 = (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:+5:15: +5:18
|
||||
_4 = Eq(move _5, const 5_i32); // scope 1 at $DIR/const_prop_miscompile.rs:+5:13: +5:25
|
||||
StorageDead(_5); // scope 1 at $DIR/const_prop_miscompile.rs:+5:24: +5:25
|
||||
nop; // scope 0 at $DIR/const_prop_miscompile.rs:+0:10: +6:2
|
||||
StorageDead(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+6:1: +6:2
|
||||
StorageLive(_2); // scope 2 at $DIR/const_prop_miscompile.rs:+3:10: +3:22
|
||||
_2 = &raw mut (_1.0: i32); // scope 2 at $DIR/const_prop_miscompile.rs:+3:10: +3:22
|
||||
(*_2) = const 5_i32; // scope 2 at $DIR/const_prop_miscompile.rs:+3:9: +3:26
|
||||
StorageDead(_2); // scope 2 at $DIR/const_prop_miscompile.rs:+3:26: +3:27
|
||||
StorageLive(_3); // scope 1 at $DIR/const_prop_miscompile.rs:+5:9: +5:10
|
||||
StorageLive(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+5:13: +5:20
|
||||
_4 = (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:+5:15: +5:18
|
||||
_3 = Eq(move _4, const 5_i32); // scope 1 at $DIR/const_prop_miscompile.rs:+5:13: +5:25
|
||||
StorageDead(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+5:24: +5:25
|
||||
StorageDead(_3); // scope 1 at $DIR/const_prop_miscompile.rs:+6:1: +6:2
|
||||
StorageDead(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+6:1: +6:2
|
||||
return; // scope 0 at $DIR/const_prop_miscompile.rs:+6:2: +6:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
_4 = (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:+3:15: +3:18
|
||||
_3 = Eq(move _4, const 5_i32); // scope 1 at $DIR/const_prop_miscompile.rs:+3:13: +3:25
|
||||
StorageDead(_4); // scope 1 at $DIR/const_prop_miscompile.rs:+3:24: +3:25
|
||||
nop; // scope 0 at $DIR/const_prop_miscompile.rs:+0:10: +4:2
|
||||
StorageDead(_3); // scope 1 at $DIR/const_prop_miscompile.rs:+4:1: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/const_prop_miscompile.rs:+4:1: +4:2
|
||||
return; // scope 0 at $DIR/const_prop_miscompile.rs:+4:2: +4:2
|
||||
|
|
|
|||
|
|
@ -5,40 +5,34 @@
|
|||
let mut _0: (); // return place in scope 0 at $DIR/inherit_overflow.rs:+0:11: +0:11
|
||||
let mut _1: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
let mut _2: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
let mut _3: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
scope 1 {
|
||||
}
|
||||
scope 2 (inlined <u8 as Add>::add) { // at $DIR/inherit_overflow.rs:7:13: 7:47
|
||||
debug self => _2; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
debug other => _3; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
debug self => _1; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
debug other => _2; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
let mut _3: u8; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
let mut _4: u8; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
let mut _5: u8; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
let mut _6: (u8, bool); // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
let mut _5: (u8, bool); // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
_1 = const u8::MAX; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
StorageLive(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
_2 = const u8::MAX; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
StorageLive(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
_3 = const 1_u8; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
_2 = const 1_u8; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
StorageLive(_3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
_3 = const u8::MAX; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
StorageLive(_4); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
_4 = const u8::MAX; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
StorageLive(_5); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
_5 = const 1_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
_6 = CheckedAdd(const u8::MAX, const 1_u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
_4 = const 1_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
_5 = CheckedAdd(const u8::MAX, const 1_u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
}
|
||||
|
||||
bb1: {
|
||||
- _1 = move (_6.0: u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
+ _1 = const 0_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
StorageDead(_5); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
StorageDead(_4); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
StorageDead(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
StorageDead(_3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
||||
StorageDead(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
StorageDead(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:47: +3:48
|
||||
nop; // scope 0 at $DIR/inherit_overflow.rs:+0:11: +4:2
|
||||
StorageDead(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
|
||||
return; // scope 0 at $DIR/inherit_overflow.rs:+4:2: +4:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,14 +59,6 @@
|
|||
- _4 = const (); // scope 0 at $DIR/cycle.rs:+3:18: +8:6
|
||||
- StorageDead(_6); // scope 0 at $DIR/cycle.rs:+8:5: +8:6
|
||||
+ StorageLive(_5); // scope 0 at $DIR/cycle.rs:+4:13: +4:17
|
||||
+ nop; // scope 0 at $DIR/cycle.rs:+4:20: +4:21
|
||||
+ nop; // scope 1 at $DIR/cycle.rs:+5:13: +5:14
|
||||
+ nop; // scope 1 at $DIR/cycle.rs:+5:9: +5:14
|
||||
+ nop; // scope 1 at $DIR/cycle.rs:+6:13: +6:14
|
||||
+ nop; // scope 1 at $DIR/cycle.rs:+6:9: +6:14
|
||||
+ nop; // scope 1 at $DIR/cycle.rs:+7:13: +7:17
|
||||
+ nop; // scope 1 at $DIR/cycle.rs:+7:9: +7:17
|
||||
+ nop; // scope 0 at $DIR/cycle.rs:+3:18: +8:6
|
||||
StorageDead(_5); // scope 0 at $DIR/cycle.rs:+8:5: +8:6
|
||||
+ StorageDead(_4); // scope 0 at $DIR/cycle.rs:+8:5: +8:6
|
||||
goto -> bb1; // scope 0 at $DIR/cycle.rs:+3:5: +8:6
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ fn f(_1: usize) -> usize {
|
|||
bb0: {
|
||||
nop; // scope 0 at $DIR/dead_stores_better.rs:+1:9: +1:10
|
||||
nop; // scope 0 at $DIR/dead_stores_better.rs:+1:13: +1:14
|
||||
nop; // scope 1 at $DIR/dead_stores_better.rs:+2:5: +2:10
|
||||
nop; // scope 1 at $DIR/dead_stores_better.rs:+3:9: +3:10
|
||||
nop; // scope 1 at $DIR/dead_stores_better.rs:+3:9: +3:10
|
||||
nop; // scope 1 at $DIR/dead_stores_better.rs:+3:5: +3:10
|
||||
|
|
|
|||
|
|
@ -25,11 +25,8 @@
|
|||
}
|
||||
|
||||
bb1: {
|
||||
nop; // scope 0 at $DIR/union.rs:+5:14: +5:30
|
||||
nop; // scope 0 at $DIR/union.rs:+5:14: +5:30
|
||||
StorageDead(_2); // scope 0 at $DIR/union.rs:+5:29: +5:30
|
||||
StorageLive(_3); // scope 1 at $DIR/union.rs:+7:10: +7:26
|
||||
nop; // scope 2 at $DIR/union.rs:+7:19: +7:24
|
||||
StorageDead(_3); // scope 1 at $DIR/union.rs:+7:26: +7:27
|
||||
StorageDead(_1); // scope 0 at $DIR/union.rs:+8:1: +8:2
|
||||
return; // scope 0 at $DIR/union.rs:+8:2: +8:2
|
||||
|
|
|
|||
|
|
@ -7,41 +7,36 @@
|
|||
let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue_73223.rs:+1:23: +1:30
|
||||
let mut _3: isize; // in scope 0 at $DIR/issue_73223.rs:+2:9: +2:16
|
||||
let _4: i32; // in scope 0 at $DIR/issue_73223.rs:+2:14: +2:15
|
||||
let mut _5: !; // in scope 0 at $DIR/issue_73223.rs:+3:17: +3:23
|
||||
let mut _7: i32; // in scope 0 at $DIR/issue_73223.rs:+6:22: +6:27
|
||||
let _8: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _9: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _10: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _11: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _12: i32; // in scope 0 at $DIR/issue_73223.rs:+7:23: +7:24
|
||||
let mut _15: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _16: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _17: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _18: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _19: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _21: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _22: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _23: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _24: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _6: i32; // in scope 0 at $DIR/issue_73223.rs:+6:22: +6:27
|
||||
let mut _7: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _8: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _11: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _12: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _13: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _14: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _16: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _17: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _18: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _19: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _20: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _21: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _22: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _24: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _25: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _26: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _27: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _29: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _30: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
scope 1 {
|
||||
debug split => _1; // in scope 1 at $DIR/issue_73223.rs:+1:9: +1:14
|
||||
let _6: std::option::Option<i32>; // in scope 1 at $DIR/issue_73223.rs:+6:9: +6:14
|
||||
let _5: std::option::Option<i32>; // in scope 1 at $DIR/issue_73223.rs:+6:9: +6:14
|
||||
scope 3 {
|
||||
debug _prev => _6; // in scope 3 at $DIR/issue_73223.rs:+6:9: +6:14
|
||||
let _13: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _14: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _28: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
debug _prev => _5; // in scope 3 at $DIR/issue_73223.rs:+6:9: +6:14
|
||||
let _9: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _10: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _23: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
scope 4 {
|
||||
debug left_val => _13; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
debug right_val => _14; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _20: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
debug left_val => _9; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
debug right_val => _10; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let _15: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
scope 5 {
|
||||
debug kind => _20; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
debug kind => _15; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -61,7 +56,6 @@
|
|||
}
|
||||
|
||||
bb1: {
|
||||
nop; // scope 0 at $DIR/issue_73223.rs:+3:17: +3:23
|
||||
StorageDead(_2); // scope 0 at $DIR/issue_73223.rs:+4:6: +4:7
|
||||
StorageDead(_1); // scope 0 at $DIR/issue_73223.rs:+8:1: +8:2
|
||||
return; // scope 0 at $DIR/issue_73223.rs:+8:2: +8:2
|
||||
|
|
@ -77,70 +71,69 @@
|
|||
_1 = _4; // scope 2 at $DIR/issue_73223.rs:+2:20: +2:21
|
||||
StorageDead(_4); // scope 0 at $DIR/issue_73223.rs:+2:20: +2:21
|
||||
StorageDead(_2); // scope 0 at $DIR/issue_73223.rs:+4:6: +4:7
|
||||
StorageLive(_6); // scope 1 at $DIR/issue_73223.rs:+6:9: +6:14
|
||||
StorageLive(_7); // scope 1 at $DIR/issue_73223.rs:+6:22: +6:27
|
||||
_7 = _1; // scope 1 at $DIR/issue_73223.rs:+6:22: +6:27
|
||||
Deinit(_6); // scope 1 at $DIR/issue_73223.rs:+6:17: +6:28
|
||||
((_6 as Some).0: i32) = move _7; // scope 1 at $DIR/issue_73223.rs:+6:17: +6:28
|
||||
discriminant(_6) = 1; // scope 1 at $DIR/issue_73223.rs:+6:17: +6:28
|
||||
StorageDead(_7); // scope 1 at $DIR/issue_73223.rs:+6:27: +6:28
|
||||
StorageLive(_5); // scope 1 at $DIR/issue_73223.rs:+6:9: +6:14
|
||||
StorageLive(_6); // scope 1 at $DIR/issue_73223.rs:+6:22: +6:27
|
||||
_6 = _1; // scope 1 at $DIR/issue_73223.rs:+6:22: +6:27
|
||||
Deinit(_5); // scope 1 at $DIR/issue_73223.rs:+6:17: +6:28
|
||||
((_5 as Some).0: i32) = move _6; // scope 1 at $DIR/issue_73223.rs:+6:17: +6:28
|
||||
discriminant(_5) = 1; // scope 1 at $DIR/issue_73223.rs:+6:17: +6:28
|
||||
StorageDead(_6); // scope 1 at $DIR/issue_73223.rs:+6:27: +6:28
|
||||
StorageLive(_24); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_25); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_7 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_29); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_30); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_10 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_28 = const _; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_23 = const _; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
// mir::Constant
|
||||
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
|
||||
_11 = _28; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
Deinit(_29); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
Deinit(_30); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_29 = move _10; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_30 = move _11; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_13 = _29; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_14 = _30; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_17 = (*_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_18 = const 1_i32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_16 = Eq(move _17, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
switchInt(move _15) -> [0: bb5, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_8 = _23; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
Deinit(_24); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
Deinit(_25); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_24 = move _7; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_25 = move _8; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_9 = _24; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_10 = _25; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_13 = (*_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_14); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_14 = const 1_i32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_12 = Eq(move _13, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_14); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_11 = Not(move _12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
switchInt(move _11) -> [0: bb5, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
}
|
||||
|
||||
bb4: {
|
||||
StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
Deinit(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
discriminant(_20) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_22 = const core::panicking::AssertKind::Eq; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
Deinit(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
discriminant(_15) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_17 = const core::panicking::AssertKind::Eq; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
// mir::Constant
|
||||
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
|
||||
StorageLive(_23); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_24); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_24 = _13; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_23 = _24; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_25); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_26); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_26 = _14; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_25 = _26; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
Deinit(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
discriminant(_27) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_21 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_19 = _9; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_18 = _19; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_20); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_21 = _10; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_20 = _21; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageLive(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
Deinit(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
discriminant(_22) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_16 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _18, move _20, move _22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
// mir::Constant
|
||||
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
// + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a i32, &'b i32, Option<Arguments<'c>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(<ZST>) }
|
||||
|
|
@ -150,15 +143,12 @@
|
|||
}
|
||||
|
||||
bb5: {
|
||||
nop; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_29); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_30); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
nop; // scope 0 at $DIR/issue_73223.rs:+0:11: +8:2
|
||||
StorageDead(_6); // scope 1 at $DIR/issue_73223.rs:+8:1: +8:2
|
||||
StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_24); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_25); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_5); // scope 1 at $DIR/issue_73223.rs:+8:1: +8:2
|
||||
StorageDead(_1); // scope 0 at $DIR/issue_73223.rs:+8:1: +8:2
|
||||
return; // scope 0 at $DIR/issue_73223.rs:+8:2: +8:2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,26 +11,19 @@
|
|||
let mut _6: T; // in scope 0 at $DIR/issue_76432.rs:+1:21: +1:22
|
||||
let mut _7: T; // in scope 0 at $DIR/issue_76432.rs:+1:24: +1:25
|
||||
let mut _8: T; // in scope 0 at $DIR/issue_76432.rs:+1:27: +1:28
|
||||
let _9: [*const T; 3]; // in scope 0 at $DIR/issue_76432.rs:+2:5: +5:6
|
||||
let mut _9: usize; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
let mut _10: usize; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
let mut _11: usize; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
let mut _12: bool; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
let mut _16: *const T; // in scope 0 at $DIR/issue_76432.rs:+3:38: +3:52
|
||||
let mut _17: *const T; // in scope 0 at $DIR/issue_76432.rs:+3:38: +3:52
|
||||
let mut _18: *const T; // in scope 0 at $DIR/issue_76432.rs:+3:54: +3:68
|
||||
let mut _19: *const T; // in scope 0 at $DIR/issue_76432.rs:+3:54: +3:68
|
||||
let mut _20: *const T; // in scope 0 at $DIR/issue_76432.rs:+3:70: +3:84
|
||||
let mut _21: *const T; // in scope 0 at $DIR/issue_76432.rs:+3:70: +3:84
|
||||
let mut _22: !; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL
|
||||
let mut _11: bool; // in scope 0 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
let mut _15: !; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL
|
||||
scope 1 {
|
||||
debug v => _2; // in scope 1 at $DIR/issue_76432.rs:+1:9: +1:10
|
||||
let _13: &T; // in scope 1 at $DIR/issue_76432.rs:+3:10: +3:16
|
||||
let _14: &T; // in scope 1 at $DIR/issue_76432.rs:+3:18: +3:24
|
||||
let _15: &T; // in scope 1 at $DIR/issue_76432.rs:+3:26: +3:32
|
||||
let _12: &T; // in scope 1 at $DIR/issue_76432.rs:+3:10: +3:16
|
||||
let _13: &T; // in scope 1 at $DIR/issue_76432.rs:+3:18: +3:24
|
||||
let _14: &T; // in scope 1 at $DIR/issue_76432.rs:+3:26: +3:32
|
||||
scope 2 {
|
||||
debug v1 => _13; // in scope 2 at $DIR/issue_76432.rs:+3:10: +3:16
|
||||
debug v2 => _14; // in scope 2 at $DIR/issue_76432.rs:+3:18: +3:24
|
||||
debug v3 => _15; // in scope 2 at $DIR/issue_76432.rs:+3:26: +3:32
|
||||
debug v1 => _12; // in scope 2 at $DIR/issue_76432.rs:+3:10: +3:16
|
||||
debug v2 => _13; // in scope 2 at $DIR/issue_76432.rs:+3:18: +3:24
|
||||
debug v3 => _14; // in scope 2 at $DIR/issue_76432.rs:+3:26: +3:32
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -54,18 +47,17 @@
|
|||
_2 = move _3 as &[T] (Pointer(Unsize)); // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29
|
||||
StorageDead(_3); // scope 0 at $DIR/issue_76432.rs:+1:28: +1:29
|
||||
StorageDead(_4); // scope 0 at $DIR/issue_76432.rs:+1:29: +1:30
|
||||
StorageLive(_9); // scope 1 at $DIR/issue_76432.rs:+2:5: +5:6
|
||||
_10 = Len((*_2)); // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
_11 = const 3_usize; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
- _12 = Eq(move _10, const 3_usize); // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
- switchInt(move _12) -> [0: bb1, otherwise: bb2]; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
_9 = Len((*_2)); // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
_10 = const 3_usize; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
- _11 = Eq(move _9, const 3_usize); // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
- switchInt(move _11) -> [0: bb1, otherwise: bb2]; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
+ nop; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
+ switchInt(move _10) -> [3: bb2, otherwise: bb1]; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
+ switchInt(move _9) -> [3: bb2, otherwise: bb1]; // scope 1 at $DIR/issue_76432.rs:+3:9: +3:33
|
||||
}
|
||||
|
||||
bb1: {
|
||||
StorageLive(_22); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL
|
||||
_22 = core::panicking::panic(const "internal error: entered unreachable code"); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL
|
||||
StorageLive(_15); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL
|
||||
_15 = core::panicking::panic(const "internal error: entered unreachable code"); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL
|
||||
// mir::Constant
|
||||
// + span: $SRC_DIR/core/src/panic.rs:LL:COL
|
||||
// + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(<ZST>) }
|
||||
|
|
@ -75,36 +67,15 @@
|
|||
}
|
||||
|
||||
bb2: {
|
||||
StorageLive(_13); // scope 1 at $DIR/issue_76432.rs:+3:10: +3:16
|
||||
_13 = &(*_2)[0 of 3]; // scope 1 at $DIR/issue_76432.rs:+3:10: +3:16
|
||||
StorageLive(_14); // scope 1 at $DIR/issue_76432.rs:+3:18: +3:24
|
||||
_14 = &(*_2)[1 of 3]; // scope 1 at $DIR/issue_76432.rs:+3:18: +3:24
|
||||
StorageLive(_15); // scope 1 at $DIR/issue_76432.rs:+3:26: +3:32
|
||||
_15 = &(*_2)[2 of 3]; // scope 1 at $DIR/issue_76432.rs:+3:26: +3:32
|
||||
StorageLive(_16); // scope 2 at $DIR/issue_76432.rs:+3:38: +3:52
|
||||
StorageLive(_17); // scope 2 at $DIR/issue_76432.rs:+3:38: +3:52
|
||||
_17 = &raw const (*_13); // scope 2 at $DIR/issue_76432.rs:+3:38: +3:40
|
||||
_16 = _17; // scope 2 at $DIR/issue_76432.rs:+3:38: +3:52
|
||||
StorageLive(_18); // scope 2 at $DIR/issue_76432.rs:+3:54: +3:68
|
||||
StorageLive(_19); // scope 2 at $DIR/issue_76432.rs:+3:54: +3:68
|
||||
_19 = &raw const (*_14); // scope 2 at $DIR/issue_76432.rs:+3:54: +3:56
|
||||
_18 = _19; // scope 2 at $DIR/issue_76432.rs:+3:54: +3:68
|
||||
StorageLive(_20); // scope 2 at $DIR/issue_76432.rs:+3:70: +3:84
|
||||
StorageLive(_21); // scope 2 at $DIR/issue_76432.rs:+3:70: +3:84
|
||||
_21 = &raw const (*_15); // scope 2 at $DIR/issue_76432.rs:+3:70: +3:72
|
||||
_20 = _21; // scope 2 at $DIR/issue_76432.rs:+3:70: +3:84
|
||||
_9 = [move _16, move _18, move _20]; // scope 2 at $DIR/issue_76432.rs:+3:37: +3:85
|
||||
StorageDead(_21); // scope 2 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageDead(_20); // scope 2 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageDead(_19); // scope 2 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageDead(_18); // scope 2 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageDead(_17); // scope 2 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageDead(_16); // scope 2 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageDead(_15); // scope 1 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageLive(_12); // scope 1 at $DIR/issue_76432.rs:+3:10: +3:16
|
||||
_12 = &(*_2)[0 of 3]; // scope 1 at $DIR/issue_76432.rs:+3:10: +3:16
|
||||
StorageLive(_13); // scope 1 at $DIR/issue_76432.rs:+3:18: +3:24
|
||||
_13 = &(*_2)[1 of 3]; // scope 1 at $DIR/issue_76432.rs:+3:18: +3:24
|
||||
StorageLive(_14); // scope 1 at $DIR/issue_76432.rs:+3:26: +3:32
|
||||
_14 = &(*_2)[2 of 3]; // scope 1 at $DIR/issue_76432.rs:+3:26: +3:32
|
||||
StorageDead(_14); // scope 1 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageDead(_13); // scope 1 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageDead(_9); // scope 1 at $DIR/issue_76432.rs:+5:6: +5:7
|
||||
nop; // scope 0 at $DIR/issue_76432.rs:+0:44: +6:2
|
||||
StorageDead(_12); // scope 1 at $DIR/issue_76432.rs:+3:84: +3:85
|
||||
StorageDead(_5); // scope 0 at $DIR/issue_76432.rs:+6:1: +6:2
|
||||
StorageDead(_2); // scope 0 at $DIR/issue_76432.rs:+6:1: +6:2
|
||||
return; // scope 0 at $DIR/issue_76432.rs:+6:2: +6:2
|
||||
|
|
|
|||
|
|
@ -23,12 +23,10 @@
|
|||
|
||||
bb2: {
|
||||
StorageDead(_2); // scope 0 at $DIR/simplify_if.rs:+2:15: +2:16
|
||||
nop; // scope 0 at $DIR/simplify_if.rs:+1:14: +3:6
|
||||
goto -> bb4; // scope 0 at $DIR/simplify_if.rs:+1:5: +3:6
|
||||
}
|
||||
|
||||
bb3: {
|
||||
nop; // scope 0 at $DIR/simplify_if.rs:+3:6: +3:6
|
||||
goto -> bb4; // scope 0 at $DIR/simplify_if.rs:+1:5: +3:6
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
- // MIR for `c` before SimplifyLocals
|
||||
+ // MIR for `c` after SimplifyLocals
|
||||
- // MIR for `c` before SimplifyLocals-before-const-prop
|
||||
+ // MIR for `c` after SimplifyLocals-before-const-prop
|
||||
|
||||
fn c() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:8: +0:8
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
- // MIR for `d1` before SimplifyLocals
|
||||
+ // MIR for `d1` after SimplifyLocals
|
||||
- // MIR for `d1` before SimplifyLocals-before-const-prop
|
||||
+ // MIR for `d1` after SimplifyLocals-before-const-prop
|
||||
|
||||
fn d1() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
- // MIR for `d2` before SimplifyLocals
|
||||
+ // MIR for `d2` after SimplifyLocals
|
||||
- // MIR for `d2` before SimplifyLocals-before-const-prop
|
||||
+ // MIR for `d2` after SimplifyLocals-before-const-prop
|
||||
|
||||
fn d2() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:9: +0:9
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
- // MIR for `expose_addr` before SimplifyLocals
|
||||
+ // MIR for `expose_addr` after SimplifyLocals
|
||||
- // MIR for `expose_addr` before SimplifyLocals-before-const-prop
|
||||
+ // MIR for `expose_addr` after SimplifyLocals-before-const-prop
|
||||
|
||||
fn expose_addr(_1: *const usize) -> () {
|
||||
debug p => _1; // in scope 0 at $DIR/simplify_locals.rs:+0:16: +0:17
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
- // MIR for `r` before SimplifyLocals
|
||||
+ // MIR for `r` after SimplifyLocals
|
||||
- // MIR for `r` before SimplifyLocals-before-const-prop
|
||||
+ // MIR for `r` after SimplifyLocals-before-const-prop
|
||||
|
||||
fn r() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/simplify_locals.rs:+0:8: +0:8
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue