Auto merge of #82896 - Dylan-DPC:rollup-9setmme, r=Dylan-DPC

Rollup of 10 pull requests

Successful merges:

 - #82047 (bypass auto_da_alloc for metadata files)
 - #82415 (expand: Refactor module loading)
 - #82557 (Add natvis for Result, NonNull, CString, CStr, and Cow)
 - #82613 (Remove Item::kind, use tagged enum. Rename variants to match)
 - #82642 (Fix jemalloc usage on OSX)
 - #82682 (Implement built-in attribute macro `#[cfg_eval]` + some refactoring)
 - #82684 (Disable destination propagation on all mir-opt-levels)
 - #82755 (Refactor confirm_builtin_call, remove partial if)
 - #82857 (Edit ructc_ast_lowering docs)
 - #82862 (Generalize Write impl for Vec<u8> to Vec<u8, A>)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2021-03-08 14:59:20 +00:00
commit 8f349be278
62 changed files with 1375 additions and 868 deletions

View file

@ -397,6 +397,7 @@ impl<'a> Builder<'a> {
test::Crate,
test::CrateLibrustc,
test::CrateRustdoc,
test::CrateRustdocJsonTypes,
test::Linkcheck,
test::TierCheck,
test::Cargotest,

View file

@ -1922,6 +1922,77 @@ impl Step for CrateRustdoc {
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct CrateRustdocJsonTypes {
host: TargetSelection,
test_kind: TestKind,
}
impl Step for CrateRustdocJsonTypes {
type Output = ();
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/rustdoc-json-types")
}
fn make_run(run: RunConfig<'_>) {
let builder = run.builder;
let test_kind = builder.kind.into();
builder.ensure(CrateRustdocJsonTypes { host: run.target, test_kind });
}
fn run(self, builder: &Builder<'_>) {
let test_kind = self.test_kind;
let target = self.host;
// Use the previous stage compiler to reuse the artifacts that are
// created when running compiletest for src/test/rustdoc. If this used
// `compiler`, then it would cause rustdoc to be built *again*, which
// isn't really necessary.
let compiler = builder.compiler_for(builder.top_stage, target, target);
builder.ensure(compile::Rustc { compiler, target });
let mut cargo = tool::prepare_tool_cargo(
builder,
compiler,
Mode::ToolRustc,
target,
test_kind.subcommand(),
"src/rustdoc-json-types",
SourceType::InTree,
&[],
);
if test_kind.subcommand() == "test" && !builder.fail_fast {
cargo.arg("--no-fail-fast");
}
cargo.arg("-p").arg("rustdoc-json-types");
cargo.arg("--");
cargo.args(&builder.config.cmd.test_args());
if self.host.contains("musl") {
cargo.arg("'-Ctarget-feature=-crt-static'");
}
if !builder.config.verbose_tests {
cargo.arg("--quiet");
}
builder.info(&format!(
"{} rustdoc-json-types stage{} ({} -> {})",
test_kind, compiler.stage, &compiler.host, target
));
let _time = util::timeit(&builder);
try_run(builder, &mut cargo.into());
}
}
/// Some test suites are run inside emulators or on remote devices, and most
/// of our test binaries are linked dynamically which means we need to ship
/// the standard library and such to the emulator ahead of time. This step

View file

@ -75,4 +75,11 @@
<ExpandedItem>ptr.pointer->data</ExpandedItem>
</Expand>
</Type>
<Type Name="alloc::borrow::Cow&lt;*&gt;">
<DisplayString Condition="RUST$ENUM$DISR == 0x0">Borrowed({__0})</DisplayString>
<DisplayString Condition="RUST$ENUM$DISR == 0x1">Owned({__0})</DisplayString>
<Expand>
<Item Name="[value]" ExcludeView="simple">__0</Item>
</Expand>
</Type>
</AutoVisualizer>

View file

@ -30,4 +30,19 @@
</Expand>
</Type>
<Type Name="core::result::Result&lt;*&gt;">
<DisplayString Condition="RUST$ENUM$DISR == 0x0">Ok({__0})</DisplayString>
<DisplayString Condition="RUST$ENUM$DISR == 0x1">Err({(*($T2*) &amp;__0)})</DisplayString>
<Expand>
<Item Name="[value]" Condition="RUST$ENUM$DISR == 0x0">__0</Item>
<Item Name="[value]" Condition="RUST$ENUM$DISR == 0x1">(*($T2*) &amp;__0)</Item>
</Expand>
</Type>
<Type Name="core::ptr::non_null::NonNull&lt;*&gt;">
<DisplayString>{(void*) pointer}</DisplayString>
<Expand>
<Item Name="[value]">*pointer</Item>
</Expand>
</Type>
</AutoVisualizer>

View file

@ -72,4 +72,33 @@
</CustomListItems>
</Expand>
</Type>
<Type Name="std::ffi::c_str::CString">
<DisplayString>{inner.data_ptr,s}</DisplayString>
<Expand>
<Synthetic Name="[chars]">
<Expand>
<ArrayItems>
<Size>inner.length</Size>
<ValuePointer>(char*)inner.data_ptr</ValuePointer>
</ArrayItems>
</Expand>
</Synthetic>
</Expand>
</Type>
<Type Name="std::ffi::c_str::CStr">
<DisplayString>{(char*) inner}</DisplayString>
<Expand>
<Synthetic Name="[chars]">
<DisplayString>{(char*) inner}</DisplayString>
<Expand>
<ArrayItems>
<Size>strlen((char *) inner) + 1</Size>
<ValuePointer>(char*)inner</ValuePointer>
</ArrayItems>
</Expand>
</Synthetic>
</Expand>
</Type>
</AutoVisualizer>

View file

@ -23,7 +23,6 @@ use std::collections::HashSet;
impl JsonRenderer<'_> {
pub(super) fn convert_item(&self, item: clean::Item) -> Option<Item> {
let item_type = ItemType::from(&item);
let deprecation = item.deprecation(self.tcx);
let clean::Item { source, name, attrs, kind, visibility, def_id } = item;
let inner = match *kind {
@ -50,7 +49,6 @@ impl JsonRenderer<'_> {
.map(rustc_ast_pretty::pprust::attribute_to_string)
.collect(),
deprecation: deprecation.map(from_deprecation),
kind: item_type.into(),
inner,
})
}
@ -154,30 +152,30 @@ crate fn from_def_id(did: DefId) -> Id {
fn from_clean_item_kind(item: clean::ItemKind, tcx: TyCtxt<'_>, name: &Option<Symbol>) -> ItemEnum {
use clean::ItemKind::*;
match item {
ModuleItem(m) => ItemEnum::ModuleItem(m.into()),
ImportItem(i) => ItemEnum::ImportItem(i.into()),
StructItem(s) => ItemEnum::StructItem(s.into()),
UnionItem(u) => ItemEnum::UnionItem(u.into()),
StructFieldItem(f) => ItemEnum::StructFieldItem(f.into()),
EnumItem(e) => ItemEnum::EnumItem(e.into()),
VariantItem(v) => ItemEnum::VariantItem(v.into()),
FunctionItem(f) => ItemEnum::FunctionItem(f.into()),
ForeignFunctionItem(f) => ItemEnum::FunctionItem(f.into()),
TraitItem(t) => ItemEnum::TraitItem(t.into()),
TraitAliasItem(t) => ItemEnum::TraitAliasItem(t.into()),
MethodItem(m, _) => ItemEnum::MethodItem(from_function_method(m, true)),
TyMethodItem(m) => ItemEnum::MethodItem(from_function_method(m, false)),
ImplItem(i) => ItemEnum::ImplItem(i.into()),
StaticItem(s) => ItemEnum::StaticItem(from_clean_static(s, tcx)),
ForeignStaticItem(s) => ItemEnum::StaticItem(from_clean_static(s, tcx)),
ForeignTypeItem => ItemEnum::ForeignTypeItem,
TypedefItem(t, _) => ItemEnum::TypedefItem(t.into()),
OpaqueTyItem(t) => ItemEnum::OpaqueTyItem(t.into()),
ConstantItem(c) => ItemEnum::ConstantItem(c.into()),
MacroItem(m) => ItemEnum::MacroItem(m.source),
ProcMacroItem(m) => ItemEnum::ProcMacroItem(m.into()),
AssocConstItem(t, s) => ItemEnum::AssocConstItem { type_: t.into(), default: s },
AssocTypeItem(g, t) => ItemEnum::AssocTypeItem {
ModuleItem(m) => ItemEnum::Module(m.into()),
ImportItem(i) => ItemEnum::Import(i.into()),
StructItem(s) => ItemEnum::Struct(s.into()),
UnionItem(u) => ItemEnum::Union(u.into()),
StructFieldItem(f) => ItemEnum::StructField(f.into()),
EnumItem(e) => ItemEnum::Enum(e.into()),
VariantItem(v) => ItemEnum::Variant(v.into()),
FunctionItem(f) => ItemEnum::Function(f.into()),
ForeignFunctionItem(f) => ItemEnum::Function(f.into()),
TraitItem(t) => ItemEnum::Trait(t.into()),
TraitAliasItem(t) => ItemEnum::TraitAlias(t.into()),
MethodItem(m, _) => ItemEnum::Method(from_function_method(m, true)),
TyMethodItem(m) => ItemEnum::Method(from_function_method(m, false)),
ImplItem(i) => ItemEnum::Impl(i.into()),
StaticItem(s) => ItemEnum::Static(from_clean_static(s, tcx)),
ForeignStaticItem(s) => ItemEnum::Static(from_clean_static(s, tcx)),
ForeignTypeItem => ItemEnum::ForeignType,
TypedefItem(t, _) => ItemEnum::Typedef(t.into()),
OpaqueTyItem(t) => ItemEnum::OpaqueTy(t.into()),
ConstantItem(c) => ItemEnum::Constant(c.into()),
MacroItem(m) => ItemEnum::Macro(m.source),
ProcMacroItem(m) => ItemEnum::ProcMacro(m.into()),
AssocConstItem(t, s) => ItemEnum::AssocConst { type_: t.into(), default: s },
AssocTypeItem(g, t) => ItemEnum::AssocType {
bounds: g.into_iter().map(Into::into).collect(),
default: t.map(Into::into),
},
@ -185,7 +183,7 @@ fn from_clean_item_kind(item: clean::ItemKind, tcx: TyCtxt<'_>, name: &Option<Sy
PrimitiveItem(_) | KeywordItem(_) => {
panic!("{:?} is not supported for JSON output", item)
}
ExternCrateItem { ref src } => ItemEnum::ExternCrateItem {
ExternCrateItem { ref src } => ItemEnum::ExternCrate {
name: name.as_ref().unwrap().to_string(),
rename: src.map(|x| x.to_string()),
},

View file

@ -108,8 +108,7 @@ impl JsonRenderer<'tcx> {
.last()
.map(Clone::clone),
visibility: types::Visibility::Public,
kind: types::ItemKind::Trait,
inner: types::ItemEnum::TraitItem(trait_item.clone().into()),
inner: types::ItemEnum::Trait(trait_item.clone().into()),
source: None,
docs: Default::default(),
links: Default::default(),
@ -158,11 +157,11 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
let id = item.def_id;
if let Some(mut new_item) = self.convert_item(item) {
if let types::ItemEnum::TraitItem(ref mut t) = new_item.inner {
if let types::ItemEnum::Trait(ref mut t) = new_item.inner {
t.implementors = self.get_trait_implementors(id)
} else if let types::ItemEnum::StructItem(ref mut s) = new_item.inner {
} else if let types::ItemEnum::Struct(ref mut s) = new_item.inner {
s.impls = self.get_impls(id)
} else if let types::ItemEnum::EnumItem(ref mut e) = new_item.inner {
} else if let types::ItemEnum::Enum(ref mut e) = new_item.inner {
e.impls = self.get_impls(id)
}
let removed = self.index.borrow_mut().insert(from_def_id(id), new_item.clone());

View file

@ -9,3 +9,6 @@ path = "lib.rs"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
[dev-dependencies]
serde_json = "1.0"

View file

@ -76,7 +76,7 @@ pub struct Item {
/// Stringified versions of the attributes on this item (e.g. `"#[inline]"`)
pub attrs: Vec<String>,
pub deprecation: Option<Deprecation>,
pub kind: ItemKind,
#[serde(flatten)]
pub inner: ItemEnum,
}
@ -185,48 +185,48 @@ pub enum ItemKind {
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(untagged)]
#[serde(tag = "kind", content = "inner", rename_all = "snake_case")]
pub enum ItemEnum {
ModuleItem(Module),
ExternCrateItem {
Module(Module),
ExternCrate {
name: String,
rename: Option<String>,
},
ImportItem(Import),
Import(Import),
UnionItem(Union),
StructItem(Struct),
StructFieldItem(Type),
EnumItem(Enum),
VariantItem(Variant),
Union(Union),
Struct(Struct),
StructField(Type),
Enum(Enum),
Variant(Variant),
FunctionItem(Function),
Function(Function),
TraitItem(Trait),
TraitAliasItem(TraitAlias),
MethodItem(Method),
ImplItem(Impl),
Trait(Trait),
TraitAlias(TraitAlias),
Method(Method),
Impl(Impl),
TypedefItem(Typedef),
OpaqueTyItem(OpaqueTy),
ConstantItem(Constant),
Typedef(Typedef),
OpaqueTy(OpaqueTy),
Constant(Constant),
StaticItem(Static),
Static(Static),
/// `type`s from an extern block
ForeignTypeItem,
ForeignType,
/// Declarative macro_rules! macro
MacroItem(String),
ProcMacroItem(ProcMacro),
Macro(String),
ProcMacro(ProcMacro),
AssocConstItem {
AssocConst {
#[serde(rename = "type")]
type_: Type,
/// e.g. `const X: usize = 5;`
default: Option<String>,
},
AssocTypeItem {
AssocType {
bounds: Vec<GenericBound>,
/// e.g. `type X = usize;`
default: Option<Type>,
@ -508,3 +508,6 @@ pub struct Static {
pub mutable: bool,
pub expr: String,
}
#[cfg(test)]
mod tests;

View file

@ -0,0 +1,34 @@
use super::*;
#[test]
fn test_struct_info_roundtrip() {
let s = ItemEnum::Struct(Struct {
struct_type: StructType::Plain,
generics: Generics { params: vec![], where_predicates: vec![] },
fields_stripped: false,
fields: vec![],
impls: vec![],
});
let struct_json = serde_json::to_string(&s).unwrap();
let de_s = serde_json::from_str(&struct_json).unwrap();
assert_eq!(s, de_s);
}
#[test]
fn test_union_info_roundtrip() {
let u = ItemEnum::Union(Union {
generics: Generics { params: vec![], where_predicates: vec![] },
fields_stripped: false,
fields: vec![],
impls: vec![],
});
let union_json = serde_json::to_string(&u).unwrap();
let de_u = serde_json::from_str(&union_json).unwrap();
assert_eq!(u, de_u);
}

View file

@ -5,22 +5,26 @@
debug s => _1; // in scope 0 at $DIR/deduplicate_blocks.rs:2:36: 2:37
let mut _0: bool; // return place in scope 0 at $DIR/deduplicate_blocks.rs:2:48: 2:52
let mut _2: &[u8]; // in scope 0 at $DIR/deduplicate_blocks.rs:3:11: 3:23
let mut _3: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
let mut _4: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
let mut _5: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
let mut _6: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
let mut _3: &str; // in scope 0 at $DIR/deduplicate_blocks.rs:3:11: 3:12
let mut _4: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
let mut _5: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
let mut _6: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
let mut _7: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
scope 1 (inlined core::str::<impl str>::as_bytes) { // at $DIR/deduplicate_blocks.rs:3:11: 3:23
debug self => _7; // in scope 1 at $DIR/deduplicate_blocks.rs:3:11: 3:23
let mut _7: &str; // in scope 1 at $DIR/deduplicate_blocks.rs:3:11: 3:23
debug self => _3; // in scope 1 at $DIR/deduplicate_blocks.rs:3:11: 3:23
let mut _8: &str; // in scope 1 at $DIR/deduplicate_blocks.rs:3:11: 3:23
scope 2 {
}
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/deduplicate_blocks.rs:3:11: 3:23
_7 = _1; // scope 0 at $DIR/deduplicate_blocks.rs:3:11: 3:12
- _2 = transmute::<&str, &[u8]>(move _7) -> bb14; // scope 2 at $DIR/deduplicate_blocks.rs:3:11: 3:23
+ _2 = transmute::<&str, &[u8]>(move _7) -> bb12; // scope 2 at $DIR/deduplicate_blocks.rs:3:11: 3:23
StorageLive(_3); // scope 0 at $DIR/deduplicate_blocks.rs:3:11: 3:12
_3 = _1; // scope 0 at $DIR/deduplicate_blocks.rs:3:11: 3:12
StorageLive(_8); // scope 2 at $DIR/deduplicate_blocks.rs:3:11: 3:23
_8 = _3; // scope 2 at $DIR/deduplicate_blocks.rs:3:11: 3:23
- _2 = transmute::<&str, &[u8]>(move _8) -> bb14; // scope 2 at $DIR/deduplicate_blocks.rs:3:11: 3:23
+ _2 = transmute::<&str, &[u8]>(move _8) -> bb12; // scope 2 at $DIR/deduplicate_blocks.rs:3:11: 3:23
// mir::Constant
// + span: $DIR/deduplicate_blocks.rs:3:11: 3:23
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&str) -> &[u8] {std::intrinsics::transmute::<&str, &[u8]>}, val: Value(Scalar(<ZST>)) }
@ -44,9 +48,9 @@
}
bb5: {
_3 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
_4 = Ge(move _3, const 3_usize); // scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
switchInt(move _4) -> [false: bb9, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
_4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
_5 = Ge(move _4, const 3_usize); // scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
switchInt(move _5) -> [false: bb9, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:5:9: 5:31
}
bb6: {
@ -93,9 +97,11 @@
- bb14: {
+ bb12: {
_5 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
_6 = Ge(move _5, const 4_usize); // scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
switchInt(move _6) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
StorageDead(_8); // scope 2 at $DIR/deduplicate_blocks.rs:3:11: 3:23
StorageDead(_3); // scope 0 at $DIR/deduplicate_blocks.rs:3:22: 3:23
_6 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
_7 = Ge(move _6, const 4_usize); // scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
switchInt(move _7) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/deduplicate_blocks.rs:4:9: 4:37
}
}

View file

@ -1,5 +1,5 @@
//! Tests that assignment in both branches of an `if` are eliminated.
// compile-flags: -Zunsound-mir-opts
fn val() -> i32 {
1
}

View file

@ -1,6 +1,6 @@
// Check that DestinationPropagation does not propagate an assignment to a function argument
// (doing so can break usages of the original argument value)
// compile-flags: -Zunsound-mir-opts
fn dummy(x: u8) -> u8 {
x
}

View file

@ -1,5 +1,5 @@
//! Tests that cyclic assignments don't hang DestinationPropagation, and result in reasonable code.
// compile-flags: -Zunsound-mir-opts
fn val() -> i32 {
1
}

View file

@ -1,5 +1,5 @@
//! Copy of `nrvo-simple.rs`, to ensure that full dest-prop handles it too.
// compile-flags: -Zunsound-mir-opts
// EMIT_MIR simple.nrvo.DestinationPropagation.diff
fn nrvo(init: fn(&mut [u8; 1024])) -> [u8; 1024] {
let mut buf = [0; 1024];

View file

@ -1,5 +1,5 @@
//! Tests that projections through unions cancel `DestinationPropagation`.
// compile-flags: -Zunsound-mir-opts
fn val() -> u32 {
1
}

View file

@ -17,7 +17,8 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
debug _q => _9; // in scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
debug q => (*((*_6).0: &i32)); // in scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
debug t => (*((*_6).1: &T)); // in scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
let mut _10: T; // in scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
let mut _10: i32; // in scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
let mut _11: T; // in scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
}
}
@ -39,10 +40,13 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
(_7.0: i32) = move _8; // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
StorageLive(_9); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
_9 = move (_7.0: i32); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
(_0.0: i32) = (*((*_6).0: &i32)); // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
StorageLive(_10); // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
_10 = (*((*_6).1: &T)); // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
(_0.1: T) = move _10; // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
_10 = (*((*_6).0: &i32)); // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
StorageLive(_11); // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
_11 = (*((*_6).1: &T)); // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
(_0.0: i32) = move _10; // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
(_0.1: T) = move _11; // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
StorageDead(_11); // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
StorageDead(_10); // scope 2 at $DIR/inline-closure-captures.rs:12:5: 12:9
StorageDead(_9); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
StorageDead(_8); // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9

View file

@ -5,18 +5,20 @@
let mut _0: (); // return place in scope 0 at $DIR/inline-diverging.rs:21:12: 21:12
let _1: (!, !); // in scope 0 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _2: fn() -> ! {sleep}; // in scope 0 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _7: (); // in scope 0 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _8: (); // in scope 0 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _9: (); // in scope 0 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _10: (); // in scope 0 at $DIR/inline-diverging.rs:22:5: 22:22
+ scope 1 (inlined call_twice::<!, fn() -> ! {sleep}>) { // at $DIR/inline-diverging.rs:22:5: 22:22
+ debug f => _2; // in scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ let _3: !; // in scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _4: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _5: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _6: !; // in scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _6: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _7: !; // in scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ let mut _8: !; // in scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ scope 2 {
+ debug a => _3; // in scope 2 at $DIR/inline-diverging.rs:22:5: 22:22
+ let _5: !; // in scope 2 at $DIR/inline-diverging.rs:22:5: 22:22
+ scope 3 {
+ debug b => _6; // in scope 3 at $DIR/inline-diverging.rs:22:5: 22:22
+ debug b => _5; // in scope 3 at $DIR/inline-diverging.rs:22:5: 22:22
+ }
+ scope 6 (inlined <fn() -> ! {sleep} as Fn<()>>::call - shim(fn() -> ! {sleep})) { // at $DIR/inline-diverging.rs:22:5: 22:22
+ scope 7 (inlined sleep) { // at $DIR/inline-diverging.rs:22:5: 22:22
@ -40,12 +42,11 @@
- // mir::Constant
// + span: $DIR/inline-diverging.rs:22:16: 22:21
// + literal: Const { ty: fn() -> ! {sleep}, val: Value(Scalar(<ZST>)) }
+ StorageLive(_6); // scope 0 at $DIR/inline-diverging.rs:22:5: 22:22
+ StorageLive(_3); // scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ StorageLive(_4); // scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ _4 = &_2; // scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ StorageLive(_7); // scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ _7 = const (); // scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ StorageLive(_9); // scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ _9 = const (); // scope 1 at $DIR/inline-diverging.rs:22:5: 22:22
+ goto -> bb1; // scope 4 at $DIR/inline-diverging.rs:22:5: 22:22
}

View file

@ -24,9 +24,12 @@
+ }
+ }
+ scope 6 (inlined g::{closure#0}) { // at $DIR/inline-generator.rs:9:14: 9:46
+ debug a => _8; // in scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ let mut _8: bool; // in scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ let mut _9: u32; // in scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ debug a => _11; // in scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ let mut _8: i32; // in scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ let mut _9: bool; // in scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ let mut _10: bool; // in scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ let _11: bool; // in scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ }
bb0: {
@ -65,16 +68,18 @@
- // + literal: Const { ty: for<'r> fn(std::pin::Pin<&'r mut impl std::ops::Generator<bool>>, bool) -> std::ops::GeneratorState<<impl std::ops::Generator<bool> as std::ops::Generator<bool>>::Yield, <impl std::ops::Generator<bool> as std::ops::Generator<bool>>::Return> {<impl std::ops::Generator<bool> as std::ops::Generator<bool>>::resume}, val: Value(Scalar(<ZST>)) }
+ StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ _7 = const false; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_8); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_9); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ _9 = discriminant((*(_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41 {bool, i32}]))); // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ switchInt(move _9) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_12); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ _12 = discriminant((*(_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41 {bool, i32}]))); // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
}
- bb3: {
+ bb1: {
+ StorageDead(_9); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageDead(_8); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageDead(_12); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageDead(_11); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageDead(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageDead(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
StorageDead(_2); // scope 0 at $DIR/inline-generator.rs:9:45: 9:46
StorageDead(_4); // scope 0 at $DIR/inline-generator.rs:9:46: 9:47
@ -89,28 +94,36 @@
+ }
+
+ bb3: {
+ _8 = move _7; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ switchInt(move _8) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ _9 = _11; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ }
+
+ bb4: {
+ ((_1 as Yielded).0: i32) = const 7_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ }
+
+ bb5: {
+ ((_1 as Yielded).0: i32) = const 13_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ _8 = const 13_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ }
+
+ bb6: {
+ StorageDead(_9); // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ discriminant(_1) = 0; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ discriminant((*(_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41 {bool, i32}]))) = 3; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:11: 15:39
+ }
+
+ bb7: {
+ ((_1 as Complete).0: bool) = move _7; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ discriminant((*(_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41 {bool, i32}]))) = 1; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46
+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:41: 15:41

View file

@ -6,25 +6,32 @@
let _1: i32; // in scope 0 at $DIR/issue-73223.rs:2:9: 2:14
let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:2:23: 2:30
let _3: i32; // in scope 0 at $DIR/issue-73223.rs:3:14: 3:15
let mut _5: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _6: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _7: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _8: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _9: 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 mut _12: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _13: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _5: i32; // in scope 0 at $DIR/issue-73223.rs:7:22: 7:27
let mut _6: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
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 _15: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _16: &i32; // 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 _18: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _19: std::option::Option<std::fmt::Arguments>; // 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:2:9: 2:14
let _4: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14
scope 3 {
debug _prev => _4; // in scope 3 at $DIR/issue-73223.rs:7:9: 7: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 _20: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 4 {
debug left_val => _11; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
debug right_val => _12; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _10: 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 _14: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 5 {
debug kind => _10; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
debug kind => _14; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
}
}
@ -43,36 +50,57 @@
_1 = _3; // scope 2 at $DIR/issue-73223.rs:3:20: 3:21
StorageDead(_3); // scope 0 at $DIR/issue-73223.rs:3:20: 3:21
StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7
((_4 as Some).0: i32) = _1; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27
StorageLive(_4); // scope 1 at $DIR/issue-73223.rs:7:9: 7:14
StorageLive(_5); // scope 1 at $DIR/issue-73223.rs:7:22: 7:27
_5 = _1; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27
((_4 as Some).0: i32) = move _5; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28
discriminant(_4) = 1; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28
(_5.0: &i32) = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_6 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_5); // scope 1 at $DIR/issue-73223.rs:7:27: 7:28
StorageLive(_6); // 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
_20 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// ty::Const
// + ty: &i32
// + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0]))
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) }
(_5.1: &i32) = move _6; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_11 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_12 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_9 = (*_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_8 = Eq(move _9, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_7 = Not(move _8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
switchInt(move _7) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_8 = _20; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_6.0: &i32) = move _7; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_6.1: &i32) = 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 = (_6.0: &i32); // 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 = (_6.1: &i32); // 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
_12 = Eq(move _13, const 1_i32); // 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) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb1: {
StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
discriminant(_10) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
discriminant(_13) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _11, move _12, move _13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_14); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
discriminant(_14) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_15); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_16 = _9; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_15 = _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
StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_18 = _10; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_17 = _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
discriminant(_19) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // 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<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, std::option::Option<std::fmt::Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
@ -85,8 +113,12 @@
}
bb2: {
StorageDead(_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
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(_6); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2
StorageDead(_4); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2
return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2
}

View file

@ -6,25 +6,32 @@
let _1: i32; // in scope 0 at $DIR/issue-73223.rs:2:9: 2:14
let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:2:23: 2:30
let _3: i32; // in scope 0 at $DIR/issue-73223.rs:3:14: 3:15
let mut _5: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _6: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _7: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _8: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _9: 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 mut _12: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _13: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _5: i32; // in scope 0 at $DIR/issue-73223.rs:7:22: 7:27
let mut _6: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
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 _15: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _16: &i32; // 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 _18: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _19: std::option::Option<std::fmt::Arguments>; // 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:2:9: 2:14
let _4: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14
scope 3 {
debug _prev => _4; // in scope 3 at $DIR/issue-73223.rs:7:9: 7: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 _20: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 4 {
debug left_val => _11; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
debug right_val => _12; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _10: 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 _14: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 5 {
debug kind => _10; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
debug kind => _14; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
}
}
@ -43,36 +50,57 @@
_1 = _3; // scope 2 at $DIR/issue-73223.rs:3:20: 3:21
StorageDead(_3); // scope 0 at $DIR/issue-73223.rs:3:20: 3:21
StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7
((_4 as Some).0: i32) = _1; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27
StorageLive(_4); // scope 1 at $DIR/issue-73223.rs:7:9: 7:14
StorageLive(_5); // scope 1 at $DIR/issue-73223.rs:7:22: 7:27
_5 = _1; // scope 1 at $DIR/issue-73223.rs:7:22: 7:27
((_4 as Some).0: i32) = move _5; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28
discriminant(_4) = 1; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28
(_5.0: &i32) = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_6 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_5); // scope 1 at $DIR/issue-73223.rs:7:27: 7:28
StorageLive(_6); // 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
_20 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// ty::Const
// + ty: &i32
// + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0]))
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) }
(_5.1: &i32) = move _6; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_11 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_12 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_9 = (*_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_8 = Eq(move _9, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_7 = Not(move _8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
switchInt(move _7) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_8 = _20; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_6.0: &i32) = move _7; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_6.1: &i32) = 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 = (_6.0: &i32); // 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 = (_6.1: &i32); // 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
_12 = Eq(move _13, const 1_i32); // 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) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb1: {
StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
discriminant(_10) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
discriminant(_13) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _11, move _12, move _13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_14); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
discriminant(_14) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_15); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_16 = _9; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_15 = _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
StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_18 = _10; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_17 = _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
discriminant(_19) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // 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<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, std::option::Option<std::fmt::Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
@ -85,8 +113,12 @@
}
bb2: {
StorageDead(_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
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(_6); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2
StorageDead(_4); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2
return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2
}

View file

@ -3,60 +3,67 @@
fn num_to_digit(_1: char) -> u32 {
debug num => _1; // in scope 0 at $DIR/issue-59352.rs:12:21: 12:24
let mut _0: u32; // return place in scope 0 at $DIR/issue-59352.rs:12:35: 12:38
let mut _2: std::option::Option<u32>; // in scope 0 at $DIR/issue-59352.rs:14:26: 14:41
let mut _3: char; // in scope 0 at $DIR/issue-59352.rs:14:26: 14:29
let mut _4: u32; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:23
let mut _9: isize; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:23
let mut _2: char; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:11
let mut _3: std::option::Option<u32>; // in scope 0 at $DIR/issue-59352.rs:14:26: 14:41
let mut _4: char; // in scope 0 at $DIR/issue-59352.rs:14:26: 14:29
let mut _5: u32; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:23
let mut _11: isize; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:23
scope 1 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue-59352.rs:14:8: 14:23
debug self => _7; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
debug radix => _4; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
let mut _5: &std::option::Option<u32>; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
let _6: std::option::Option<u32>; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
let mut _7: char; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
debug self => _2; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
debug radix => _5; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
let mut _6: &std::option::Option<u32>; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
let _7: std::option::Option<u32>; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
let mut _8: char; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23
scope 2 (inlined Option::<u32>::is_some) { // at $DIR/issue-59352.rs:14:8: 14:23
debug self => _5; // in scope 2 at $DIR/issue-59352.rs:14:8: 14:23
debug self => _6; // in scope 2 at $DIR/issue-59352.rs:14:8: 14:23
let mut _9: isize; // in scope 2 at $DIR/issue-59352.rs:14:8: 14:23
}
}
scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { // at $DIR/issue-59352.rs:14:26: 14:50
debug self => _2; // in scope 3 at $DIR/issue-59352.rs:14:26: 14:50
let mut _8: isize; // in scope 3 at $DIR/issue-59352.rs:14:26: 14:50
debug self => _3; // in scope 3 at $DIR/issue-59352.rs:14:26: 14:50
let mut _10: isize; // in scope 3 at $DIR/issue-59352.rs:14:26: 14:50
scope 4 {
debug val => _0; // in scope 4 at $DIR/issue-59352.rs:14:26: 14:50
}
}
bb0: {
_7 = _1; // scope 0 at $DIR/issue-59352.rs:14:8: 14:11
StorageLive(_4); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23
_4 = const 8_u32; // scope 0 at $DIR/issue-59352.rs:14:8: 14:23
StorageLive(_5); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
StorageLive(_2); // scope 0 at $DIR/issue-59352.rs:14:8: 14:11
_2 = _1; // scope 0 at $DIR/issue-59352.rs:14:8: 14:11
StorageLive(_5); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23
_5 = const 8_u32; // scope 0 at $DIR/issue-59352.rs:14:8: 14:23
StorageLive(_6); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
_6 = char::methods::<impl char>::to_digit(move _7, const 8_u32) -> bb5; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
StorageLive(_7); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
StorageLive(_8); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
_8 = _2; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
_7 = char::methods::<impl char>::to_digit(move _8, const 8_u32) -> bb5; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
// mir::Constant
// + span: $DIR/issue-59352.rs:14:8: 14:23
// + literal: Const { ty: fn(char, u32) -> std::option::Option<u32> {std::char::methods::<impl char>::to_digit}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageLive(_2); // scope 0 at $DIR/issue-59352.rs:14:26: 14:41
StorageLive(_3); // scope 0 at $DIR/issue-59352.rs:14:26: 14:29
_3 = _1; // scope 0 at $DIR/issue-59352.rs:14:26: 14:29
_2 = char::methods::<impl char>::to_digit(move _3, const 8_u32) -> bb3; // scope 0 at $DIR/issue-59352.rs:14:26: 14:41
StorageDead(_11); // scope 0 at $DIR/issue-59352.rs:14:5: 14:63
StorageLive(_3); // scope 0 at $DIR/issue-59352.rs:14:26: 14:41
StorageLive(_4); // scope 0 at $DIR/issue-59352.rs:14:26: 14:29
_4 = _1; // scope 0 at $DIR/issue-59352.rs:14:26: 14:29
_3 = char::methods::<impl char>::to_digit(move _4, const 8_u32) -> bb3; // scope 0 at $DIR/issue-59352.rs:14:26: 14:41
// mir::Constant
// + span: $DIR/issue-59352.rs:14:30: 14:38
// + literal: Const { ty: fn(char, u32) -> std::option::Option<u32> {std::char::methods::<impl char>::to_digit}, val: Value(Scalar(<ZST>)) }
}
bb2: {
StorageDead(_11); // scope 0 at $DIR/issue-59352.rs:14:5: 14:63
_0 = const 0_u32; // scope 0 at $DIR/issue-59352.rs:14:60: 14:61
goto -> bb4; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63
}
bb3: {
StorageDead(_3); // scope 0 at $DIR/issue-59352.rs:14:40: 14:41
StorageLive(_8); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50
_8 = discriminant(_2); // scope 3 at $DIR/issue-59352.rs:14:26: 14:50
switchInt(move _8) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 3 at $DIR/issue-59352.rs:14:26: 14:50
StorageDead(_4); // scope 0 at $DIR/issue-59352.rs:14:40: 14:41
StorageLive(_10); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50
_10 = discriminant(_3); // scope 3 at $DIR/issue-59352.rs:14:26: 14:50
switchInt(move _10) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 3 at $DIR/issue-59352.rs:14:26: 14:50
}
bb4: {
@ -64,12 +71,18 @@ fn num_to_digit(_1: char) -> u32 {
}
bb5: {
_5 = &_6; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
_9 = discriminant((*_5)); // scope 2 at $DIR/issue-59352.rs:14:8: 14:23
StorageDead(_5); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
_6 = &_7; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
StorageDead(_8); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
StorageLive(_9); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
_9 = discriminant((*_6)); // scope 2 at $DIR/issue-59352.rs:14:8: 14:23
StorageLive(_11); // scope 2 at $DIR/issue-59352.rs:14:8: 14:23
_11 = move _9; // scope 2 at $DIR/issue-59352.rs:14:8: 14:23
StorageDead(_9); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
StorageDead(_6); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
StorageDead(_4); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23
switchInt(move _9) -> [1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63
StorageDead(_7); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
StorageDead(_5); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23
StorageDead(_2); // scope 0 at $DIR/issue-59352.rs:14:22: 14:23
switchInt(move _11) -> [1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63
}
bb6: {
@ -90,9 +103,9 @@ fn num_to_digit(_1: char) -> u32 {
}
bb8: {
_0 = move ((_2 as Some).0: u32); // scope 3 at $DIR/issue-59352.rs:14:26: 14:50
StorageDead(_8); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50
StorageDead(_2); // scope 0 at $DIR/issue-59352.rs:14:49: 14:50
_0 = move ((_3 as Some).0: u32); // scope 3 at $DIR/issue-59352.rs:14:26: 14:50
StorageDead(_10); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50
StorageDead(_3); // scope 0 at $DIR/issue-59352.rs:14:49: 14:50
goto -> bb4; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63
}
}

View file

@ -2,9 +2,9 @@
fn f_u64() -> () {
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:34:16: 34:16
let mut _1: u64; // in scope 0 at $DIR/lower_intrinsics.rs:35:5: 35:21
scope 1 (inlined f_dispatch::<u64>) { // at $DIR/lower_intrinsics.rs:35:5: 35:21
debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21
let mut _1: u64; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21
let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21
let mut _3: u64; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21
scope 2 (inlined std::mem::size_of::<u64>) { // at $DIR/lower_intrinsics.rs:35:5: 35:21
@ -12,6 +12,7 @@ fn f_u64() -> () {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:35:5: 35:21
_1 = const 0_u64; // scope 0 at $DIR/lower_intrinsics.rs:35:5: 35:21
StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21
StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21
@ -25,6 +26,7 @@ fn f_u64() -> () {
bb1: {
StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21
StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21
StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:35:5: 35:21
_0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:34:16: 36:2
return; // scope 0 at $DIR/lower_intrinsics.rs:36:2: 36:2
}

View file

@ -17,8 +17,13 @@
StorageLive(_1); // scope 0 at $DIR/simplify-locals.rs:14:9: 14:14
_1 = [const 0_u8; 10]; // scope 0 at $DIR/simplify-locals.rs:14:17: 14:26
- StorageLive(_2); // scope 1 at $DIR/simplify-locals.rs:16:20: 16:26
- _3 = &_1; // scope 1 at $DIR/simplify-locals.rs:16:20: 16:26
- StorageLive(_3); // scope 1 at $DIR/simplify-locals.rs:16:20: 16:26
- StorageLive(_4); // scope 1 at $DIR/simplify-locals.rs:16:20: 16:26
- _4 = &_1; // scope 1 at $DIR/simplify-locals.rs:16:20: 16:26
- _3 = _4; // scope 1 at $DIR/simplify-locals.rs:16:20: 16:26
- _2 = move _3 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/simplify-locals.rs:16:20: 16:26
- StorageDead(_3); // scope 1 at $DIR/simplify-locals.rs:16:25: 16:26
- StorageDead(_4); // scope 1 at $DIR/simplify-locals.rs:16:26: 16:27
- StorageDead(_2); // scope 1 at $DIR/simplify-locals.rs:16:26: 16:27
_0 = const (); // scope 0 at $DIR/simplify-locals.rs:13:8: 17:2
StorageDead(_1); // scope 0 at $DIR/simplify-locals.rs:17:1: 17:2

View file

@ -2,7 +2,7 @@
macro_rules! mod_decl {
($i:ident) => {
mod $i; //~ ERROR Cannot declare a non-inline module inside a block
mod $i; //~ ERROR cannot declare a non-inline module inside a block
};
}

View file

@ -1,4 +1,4 @@
error: Cannot declare a non-inline module inside a block unless it has a path attribute
error: cannot declare a non-inline module inside a block unless it has a path attribute
--> $DIR/macro-expanded-mod.rs:5:9
|
LL | mod $i;

View file

@ -1,5 +1,5 @@
// Test that non-inline modules are not allowed inside blocks.
fn main() {
mod foo; //~ ERROR Cannot declare a non-inline module inside a block
mod foo; //~ ERROR cannot declare a non-inline module inside a block
}

View file

@ -1,4 +1,4 @@
error: Cannot declare a non-inline module inside a block unless it has a path attribute
error: cannot declare a non-inline module inside a block unless it has a path attribute
--> $DIR/non-inline-mod-restriction.rs:4:5
|
LL | mod foo;

View file

@ -0,0 +1,7 @@
// normalize-stderr-test: "\.:.*\(" -> ".: $$ACCESS_DENIED_MSG ("
// normalize-stderr-test: "os error \d+" -> "os error $$ACCESS_DENIED_CODE"
#[path = "."]
mod m; //~ ERROR couldn't read
fn main() {}

View file

@ -0,0 +1,8 @@
error: couldn't read $DIR/.: $ACCESS_DENIED_MSG (os error $ACCESS_DENIED_CODE)
--> $DIR/path-no-file-name.rs:5:1
|
LL | mod m;
| ^^^^^^
error: aborting due to previous error

View file

@ -1,10 +1,12 @@
// error-pattern: circular modules
#[path = "circular_modules_hello.rs"]
mod circular_modules_hello; //~ ERROR: circular modules
mod circular_modules_hello;
pub fn hi_str() -> String {
"Hi!".to_string()
}
fn main() {
circular_modules_hello::say_hello(); //~ ERROR cannot find function `say_hello` in module
circular_modules_hello::say_hello();
}

View file

@ -1,18 +1,18 @@
error: circular modules: $DIR/circular_modules_hello.rs -> $DIR/circular_modules_main.rs -> $DIR/circular_modules_hello.rs
--> $DIR/circular_modules_main.rs:2:1
error: circular modules: $DIR/circular_modules_main.rs -> $DIR/circular_modules_hello.rs -> $DIR/circular_modules_main.rs
--> $DIR/circular_modules_hello.rs:4:1
|
LL | mod circular_modules_hello;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | mod circular_modules_main;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0425]: cannot find function `say_hello` in module `circular_modules_hello`
--> $DIR/circular_modules_main.rs:9:29
error[E0425]: cannot find function `hi_str` in module `circular_modules_main`
--> $DIR/circular_modules_hello.rs:7:43
|
LL | circular_modules_hello::say_hello();
| ^^^^^^^^^ not found in `circular_modules_hello`
LL | println!("{}", circular_modules_main::hi_str());
| ^^^^^^ not found in `circular_modules_main`
|
help: consider importing this function
|
LL | use circular_modules_hello::say_hello;
LL | use hi_str;
|
error: aborting due to 2 previous errors

View file

@ -0,0 +1,9 @@
#![feature(cfg_eval)]
#![feature(stmt_expr_attributes)]
fn main() {
let _ = #[cfg_eval] #[cfg(FALSE)] 0;
//~^ ERROR removing an expression is not supported in this position
//~| ERROR removing an expression is not supported in this position
//~| ERROR removing an expression is not supported in this position
}

View file

@ -0,0 +1,20 @@
error: removing an expression is not supported in this position
--> $DIR/cfg-eval-fail.rs:5:25
|
LL | let _ = #[cfg_eval] #[cfg(FALSE)] 0;
| ^^^^^^^^^^^^^
error: removing an expression is not supported in this position
--> $DIR/cfg-eval-fail.rs:5:25
|
LL | let _ = #[cfg_eval] #[cfg(FALSE)] 0;
| ^^^^^^^^^^^^^
error: removing an expression is not supported in this position
--> $DIR/cfg-eval-fail.rs:5:25
|
LL | let _ = #[cfg_eval] #[cfg(FALSE)] 0;
| ^^^^^^^^^^^^^
error: aborting due to 3 previous errors

View file

@ -0,0 +1,32 @@
// check-pass
// compile-flags: -Z span-debug
// aux-build:test-macros.rs
#![feature(cfg_eval)]
#![feature(proc_macro_hygiene)]
#![feature(stmt_expr_attributes)]
#![no_std] // Don't load unnecessary hygiene information from std
extern crate std;
#[macro_use]
extern crate test_macros;
#[cfg_eval]
#[print_attr]
struct S1 {
#[cfg(FALSE)]
field_false: u8,
#[cfg(all(/*true*/))]
#[cfg_attr(FALSE, unknown_attr)]
#[cfg_attr(all(/*true*/), allow())]
field_true: u8,
}
#[cfg_eval]
#[cfg(FALSE)]
struct S2 {}
fn main() {
let _ = #[cfg_eval] #[print_attr](#[cfg(FALSE)] 0, #[cfg(all(/*true*/))] 1);
}

View file

@ -0,0 +1,135 @@
PRINT-ATTR INPUT (DISPLAY): struct S1 { #[cfg(all())] #[allow()] field_true : u8, }
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Ident {
ident: "S1",
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [
Punct {
ch: '#',
spacing: Alone,
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "cfg",
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "all",
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [],
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
],
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
],
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Punct {
ch: '#',
spacing: Alone,
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "allow",
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [],
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
],
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Ident {
ident: "field_true",
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Punct {
ch: ':',
spacing: Alone,
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Ident {
ident: "u8",
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
Punct {
ch: ',',
spacing: Alone,
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
],
span: $DIR/cfg-eval.rs:17:1: 24:2 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): (#[cfg(all())] 1,)
PRINT-ATTR INPUT (DEBUG): TokenStream [
Group {
delimiter: Parenthesis,
stream: TokenStream [
Punct {
ch: '#',
spacing: Alone,
span: $DIR/cfg-eval.rs:31:38: 31:80 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "cfg",
span: $DIR/cfg-eval.rs:31:38: 31:80 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "all",
span: $DIR/cfg-eval.rs:31:38: 31:80 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [],
span: $DIR/cfg-eval.rs:31:38: 31:80 (#0),
},
],
span: $DIR/cfg-eval.rs:31:38: 31:80 (#0),
},
],
span: $DIR/cfg-eval.rs:31:38: 31:80 (#0),
},
Literal {
kind: Integer,
symbol: "1",
suffix: None,
span: $DIR/cfg-eval.rs:31:38: 31:80 (#0),
},
Punct {
ch: ',',
spacing: Alone,
span: $DIR/cfg-eval.rs:31:38: 31:80 (#0),
},
],
span: $DIR/cfg-eval.rs:31:38: 31:80 (#0),
},
]