Skip to content

Commit a317055

Browse files
committed
Auto merge of #103316 - cuviper:beta-next, r=cuviper
[beta] backports - Use rebind instead of dummy binder in `SameTypeModuloInfer` relation #102059 - Add missing space between notable trait tooltip and where clause #102107 - Avoid repeated re-initialization of the BufReader buffer #102760 - Ensure enum cast moves #103016 - Fix `TyKind::is_simple_path` #103176 - Do anonymous lifetimes remapping correctly for nested rpits #103205 - [beta] Cargo backport 1.65.0 #103303 - linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO #103092 r? `@ghost`
2 parents da7ffa2 + 731bbc8 commit a317055

28 files changed

+287
-63
lines changed

Cargo.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ dependencies = [
435435

436436
[[package]]
437437
name = "cargo-util"
438-
version = "0.2.1"
438+
version = "0.2.2"
439439
dependencies = [
440440
"anyhow",
441441
"core-foundation",

compiler/rustc_ast/src/ast.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -2060,8 +2060,11 @@ impl TyKind {
20602060
}
20612061

20622062
pub fn is_simple_path(&self) -> Option<Symbol> {
2063-
if let TyKind::Path(None, Path { segments, .. }) = &self && segments.len() == 1 {
2064-
Some(segments[0].ident.name)
2063+
if let TyKind::Path(None, Path { segments, .. }) = &self
2064+
&& let [segment] = &segments[..]
2065+
&& segment.args.is_none()
2066+
{
2067+
Some(segment.ident.name)
20652068
} else {
20662069
None
20672070
}

compiler/rustc_ast_lowering/src/lib.rs

+23-20
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
499499
start
500500
}
501501

502+
/// Given the id of some node in the AST, finds the `LocalDefId` associated with it by the name
503+
/// resolver (if any).
504+
fn orig_opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId> {
505+
self.resolver.node_id_to_def_id.get(&node).map(|local_def_id| *local_def_id)
506+
}
507+
508+
fn orig_local_def_id(&self, node: NodeId) -> LocalDefId {
509+
self.orig_opt_local_def_id(node)
510+
.unwrap_or_else(|| panic!("no entry for node id: `{:?}`", node))
511+
}
512+
502513
/// Given the id of some node in the AST, finds the `LocalDefId` associated with it by the name
503514
/// resolver (if any), after applying any remapping from `get_remapped_def_id`.
504515
///
@@ -513,10 +524,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
513524
/// we would create an opaque type `type FooReturn<'a1> = impl Debug + 'a1`.
514525
/// When lowering the `Debug + 'a` bounds, we add a remapping to map `'a` to `'a1`.
515526
fn opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId> {
516-
self.resolver
517-
.node_id_to_def_id
518-
.get(&node)
519-
.map(|local_def_id| self.get_remapped_def_id(*local_def_id))
527+
self.orig_opt_local_def_id(node).map(|local_def_id| self.get_remapped_def_id(local_def_id))
520528
}
521529

522530
fn local_def_id(&self, node: NodeId) -> LocalDefId {
@@ -525,9 +533,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
525533

526534
/// Get the previously recorded `to` local def id given the `from` local def id, obtained using
527535
/// `generics_def_id_map` field.
528-
fn get_remapped_def_id(&self, mut local_def_id: LocalDefId) -> LocalDefId {
536+
fn get_remapped_def_id(&self, local_def_id: LocalDefId) -> LocalDefId {
529537
// `generics_def_id_map` is a stack of mappings. As we go deeper in impl traits nesting we
530-
// push new mappings so we need to try first the latest mappings, hence `iter().rev()`.
538+
// push new mappings, so we first need to get the latest (innermost) mappings, hence `iter().rev()`.
531539
//
532540
// Consider:
533541
//
@@ -537,18 +545,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
537545
//
538546
// `[[fn#'b -> impl_trait#'b], [fn#'b -> impl_sized#'b]]`
539547
//
540-
// for the opaque type generated on `impl Sized + 'b`, We want the result to be:
541-
// impl_sized#'b, so iterating forward is the wrong thing to do.
542-
for map in self.generics_def_id_map.iter().rev() {
543-
if let Some(r) = map.get(&local_def_id) {
544-
debug!("def_id_remapper: remapping from `{local_def_id:?}` to `{r:?}`");
545-
local_def_id = *r;
546-
} else {
547-
debug!("def_id_remapper: no remapping for `{local_def_id:?}` found in map");
548-
}
549-
}
550-
551-
local_def_id
548+
// for the opaque type generated on `impl Sized + 'b`, we want the result to be: impl_sized#'b.
549+
// So, if we were trying to find first from the start (outermost) would give the wrong result, impl_trait#'b.
550+
self.generics_def_id_map
551+
.iter()
552+
.rev()
553+
.find_map(|map| map.get(&local_def_id).map(|local_def_id| *local_def_id))
554+
.unwrap_or(local_def_id)
552555
}
553556

554557
/// Freshen the `LoweringContext` and ready it to lower a nested item.
@@ -1607,7 +1610,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16071610

16081611
LifetimeRes::Fresh { param, binder: _ } => {
16091612
debug_assert_eq!(lifetime.ident.name, kw::UnderscoreLifetime);
1610-
if let Some(old_def_id) = self.opt_local_def_id(param) && remapping.get(&old_def_id).is_none() {
1613+
if let Some(old_def_id) = self.orig_opt_local_def_id(param) && remapping.get(&old_def_id).is_none() {
16111614
let node_id = self.next_node_id();
16121615

16131616
let new_def_id = self.create_def(
@@ -1876,7 +1879,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
18761879
let extra_lifetime_params = self.resolver.take_extra_lifetime_params(opaque_ty_node_id);
18771880
debug!(?extra_lifetime_params);
18781881
for (ident, outer_node_id, outer_res) in extra_lifetime_params {
1879-
let outer_def_id = self.local_def_id(outer_node_id);
1882+
let outer_def_id = self.orig_local_def_id(outer_node_id);
18801883
let inner_node_id = self.next_node_id();
18811884

18821885
// Add a definition for the in scope lifetime def.

compiler/rustc_codegen_ssa/src/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2698,7 +2698,7 @@ fn relevant_lib(sess: &Session, lib: &NativeLib) -> bool {
26982698
}
26992699
}
27002700

2701-
fn are_upstream_rust_objects_already_included(sess: &Session) -> bool {
2701+
pub(crate) fn are_upstream_rust_objects_already_included(sess: &Session) -> bool {
27022702
match sess.lto() {
27032703
config::Lto::Fat => true,
27042704
config::Lto::Thin => {

compiler/rustc_codegen_ssa/src/base.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::back::link::are_upstream_rust_objects_already_included;
12
use crate::back::metadata::create_compressed_metadata_file;
23
use crate::back::write::{
34
compute_per_cgu_lto_type, start_async_codegen, submit_codegened_module_to_llvm,
@@ -854,10 +855,14 @@ impl CrateInfo {
854855

855856
// Handle circular dependencies in the standard library.
856857
// See comment before `add_linked_symbol_object` function for the details.
857-
// With msvc-like linkers it's both unnecessary (they support circular dependencies),
858-
// and causes linking issues (when weak lang item symbols are "privatized" by LTO).
858+
// If global LTO is enabled then almost everything (*) is glued into a single object file,
859+
// so this logic is not necessary and can cause issues on some targets (due to weak lang
860+
// item symbols being "privatized" to that object file), so we disable it.
861+
// (*) Native libs, and `#[compiler_builtins]` and `#[no_builtins]` crates are not glued,
862+
// and we assume that they cannot define weak lang items. This is not currently enforced
863+
// by the compiler, but that's ok because all this stuff is unstable anyway.
859864
let target = &tcx.sess.target;
860-
if !target.is_like_msvc {
865+
if !are_upstream_rust_objects_already_included(tcx.sess) {
861866
let missing_weak_lang_items: FxHashSet<&Symbol> = info
862867
.used_crates
863868
.iter()

compiler/rustc_infer/src/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2765,7 +2765,7 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
27652765
where
27662766
T: relate::Relate<'tcx>,
27672767
{
2768-
Ok(ty::Binder::dummy(self.relate(a.skip_binder(), b.skip_binder())?))
2768+
Ok(a.rebind(self.relate(a.skip_binder(), b.skip_binder())?))
27692769
}
27702770

27712771
fn consts(

compiler/rustc_mir_build/src/build/expr/as_rvalue.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
197197
// create all the steps directly in MIR with operations all backends need to support anyway.
198198
let (source, ty) = if let ty::Adt(adt_def, ..) = source.ty.kind() && adt_def.is_enum() {
199199
let discr_ty = adt_def.repr().discr_type().to_ty(this.tcx);
200-
let place = unpack!(block = this.as_place(block, source));
200+
let temp = unpack!(block = this.as_temp(block, scope, source, Mutability::Not));
201201
let discr = this.temp(discr_ty, source.span);
202202
this.cfg.push_assign(
203203
block,
204204
source_info,
205205
discr,
206-
Rvalue::Discriminant(place),
206+
Rvalue::Discriminant(temp.into()),
207207
);
208208

209209
(Operand::Move(discr), discr_ty)

library/std/src/io/buffered/bufreader.rs

+8
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,14 @@ impl<R> BufReader<R> {
224224
}
225225
}
226226

227+
// This is only used by a test which asserts that the initialization-tracking is correct.
228+
#[cfg(test)]
229+
impl<R> BufReader<R> {
230+
pub fn initialized(&self) -> usize {
231+
self.buf.initialized()
232+
}
233+
}
234+
227235
impl<R: Seek> BufReader<R> {
228236
/// Seeks relative to the current position. If the new position lies within the buffer,
229237
/// the buffer will not be flushed, allowing for more efficient seeks.

library/std/src/io/buffered/bufreader/buffer.rs

+16-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ pub struct Buffer {
2020
// Each call to `fill_buf` sets `filled` to indicate how many bytes at the start of `buf` are
2121
// initialized with bytes from a read.
2222
filled: usize,
23+
// This is the max number of bytes returned across all `fill_buf` calls. We track this so that we
24+
// can accurately tell `read_buf` how many bytes of buf are initialized, to bypass as much of its
25+
// defensive initialization as possible. Note that while this often the same as `filled`, it
26+
// doesn't need to be. Calls to `fill_buf` are not required to actually fill the buffer, and
27+
// omitting this is a huge perf regression for `Read` impls that do not.
28+
initialized: usize,
2329
}
2430

2531
impl Buffer {
2632
#[inline]
2733
pub fn with_capacity(capacity: usize) -> Self {
2834
let buf = Box::new_uninit_slice(capacity);
29-
Self { buf, pos: 0, filled: 0 }
35+
Self { buf, pos: 0, filled: 0, initialized: 0 }
3036
}
3137

3238
#[inline]
@@ -51,6 +57,12 @@ impl Buffer {
5157
self.pos
5258
}
5359

60+
// This is only used by a test which asserts that the initialization-tracking is correct.
61+
#[cfg(test)]
62+
pub fn initialized(&self) -> usize {
63+
self.initialized
64+
}
65+
5466
#[inline]
5567
pub fn discard_buffer(&mut self) {
5668
self.pos = 0;
@@ -96,13 +108,14 @@ impl Buffer {
96108
let mut buf = BorrowedBuf::from(&mut *self.buf);
97109
// SAFETY: `self.filled` bytes will always have been initialized.
98110
unsafe {
99-
buf.set_init(self.filled);
111+
buf.set_init(self.initialized);
100112
}
101113

102114
reader.read_buf(buf.unfilled())?;
103115

104-
self.filled = buf.len();
105116
self.pos = 0;
117+
self.filled = buf.len();
118+
self.initialized = buf.init_len();
106119
}
107120
Ok(self.buffer())
108121
}

library/std/src/io/buffered/tests.rs

+24
Original file line numberDiff line numberDiff line change
@@ -1039,3 +1039,27 @@ fn single_formatted_write() {
10391039
writeln!(&mut writer, "{}, {}!", "hello", "world").unwrap();
10401040
assert_eq!(writer.get_ref().events, [RecordedEvent::Write("hello, world!\n".to_string())]);
10411041
}
1042+
1043+
#[test]
1044+
fn bufreader_full_initialize() {
1045+
struct OneByteReader;
1046+
impl Read for OneByteReader {
1047+
fn read(&mut self, buf: &mut [u8]) -> crate::io::Result<usize> {
1048+
if buf.len() > 0 {
1049+
buf[0] = 0;
1050+
Ok(1)
1051+
} else {
1052+
Ok(0)
1053+
}
1054+
}
1055+
}
1056+
let mut reader = BufReader::new(OneByteReader);
1057+
// Nothing is initialized yet.
1058+
assert_eq!(reader.initialized(), 0);
1059+
1060+
let buf = reader.fill_buf().unwrap();
1061+
// We read one byte...
1062+
assert_eq!(buf.len(), 1);
1063+
// But we initialized the whole buffer!
1064+
assert_eq!(reader.initialized(), reader.capacity());
1065+
}

src/librustdoc/html/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(
371371
format!("<br><span class=\"where\">where{where_preds}</span>")
372372
} else {
373373
let mut clause = br_with_padding;
374-
clause.truncate(clause.len() - 5 * "&nbsp;".len());
374+
clause.truncate(clause.len() - 4 * "&nbsp;".len());
375375
write!(clause, "<span class=\"where\">where{where_preds}</span>")?;
376376
clause
377377
}

src/test/mir-opt/enum_cast.bar.mir_map.0.mir

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
fn bar(_1: Bar) -> usize {
44
debug bar => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
55
let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
6-
let mut _2: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
6+
let _2: Bar; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
7+
let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
78

89
bb0: {
9-
_2 = discriminant(_1); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
10-
_0 = move _2 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
10+
StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
11+
_2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
12+
_3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
13+
_0 = move _3 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
14+
StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
1115
return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
1216
}
1317
}

src/test/mir-opt/enum_cast.boo.mir_map.0.mir

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
fn boo(_1: Boo) -> usize {
44
debug boo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
55
let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
6-
let mut _2: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
6+
let _2: Boo; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
7+
let mut _3: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
78

89
bb0: {
9-
_2 = discriminant(_1); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
10-
_0 = move _2 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
10+
StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
11+
_2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
12+
_3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
13+
_0 = move _3 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
14+
StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
1115
return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
1216
}
1317
}

src/test/mir-opt/enum_cast.droppy.mir_map.0.mir

+26-14
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ fn droppy() -> () {
44
let mut _0: (); // return place in scope 0 at $DIR/enum_cast.rs:+0:13: +0:13
55
let _1: (); // in scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
66
let _2: Droppy; // in scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
7-
let mut _4: isize; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
8-
let _5: Droppy; // in scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
7+
let _4: Droppy; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
8+
let mut _5: isize; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
9+
let _6: Droppy; // in scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
910
scope 1 {
1011
debug x => _2; // in scope 1 at $DIR/enum_cast.rs:+2:13: +2:14
1112
scope 2 {
@@ -16,7 +17,7 @@ fn droppy() -> () {
1617
}
1718
}
1819
scope 4 {
19-
debug z => _5; // in scope 4 at $DIR/enum_cast.rs:+7:9: +7:10
20+
debug z => _6; // in scope 4 at $DIR/enum_cast.rs:+7:9: +7:10
2021
}
2122

2223
bb0: {
@@ -25,30 +26,41 @@ fn droppy() -> () {
2526
_2 = Droppy::C; // scope 0 at $DIR/enum_cast.rs:+2:17: +2:26
2627
FakeRead(ForLet(None), _2); // scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
2728
StorageLive(_3); // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
28-
_4 = discriminant(_2); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
29-
_3 = move _4 as usize (Misc); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
29+
StorageLive(_4); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:18
30+
_4 = move _2; // scope 3 at $DIR/enum_cast.rs:+5:17: +5:18
31+
_5 = discriminant(_4); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
32+
_3 = move _5 as usize (Misc); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
33+
drop(_4) -> [return: bb1, unwind: bb4]; // scope 3 at $DIR/enum_cast.rs:+5:26: +5:27
34+
}
35+
36+
bb1: {
37+
StorageDead(_4); // scope 3 at $DIR/enum_cast.rs:+5:26: +5:27
3038
FakeRead(ForLet(None), _3); // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
3139
_1 = const (); // scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
3240
StorageDead(_3); // scope 1 at $DIR/enum_cast.rs:+6:5: +6:6
33-
drop(_2) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
41+
drop(_2) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
3442
}
3543

36-
bb1: {
44+
bb2: {
3745
StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
3846
StorageDead(_1); // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
39-
StorageLive(_5); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
40-
_5 = Droppy::B; // scope 0 at $DIR/enum_cast.rs:+7:13: +7:22
41-
FakeRead(ForLet(None), _5); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
47+
StorageLive(_6); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
48+
_6 = Droppy::B; // scope 0 at $DIR/enum_cast.rs:+7:13: +7:22
49+
FakeRead(ForLet(None), _6); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
4250
_0 = const (); // scope 0 at $DIR/enum_cast.rs:+0:13: +8:2
43-
drop(_5) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
51+
drop(_6) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
4452
}
4553

46-
bb2: {
47-
StorageDead(_5); // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
54+
bb3: {
55+
StorageDead(_6); // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
4856
return; // scope 0 at $DIR/enum_cast.rs:+8:2: +8:2
4957
}
5058

51-
bb3 (cleanup): {
59+
bb4 (cleanup): {
60+
drop(_2) -> bb5; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
61+
}
62+
63+
bb5 (cleanup): {
5264
resume; // scope 0 at $DIR/enum_cast.rs:+0:1: +8:2
5365
}
5466
}

src/test/mir-opt/enum_cast.foo.mir_map.0.mir

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
fn foo(_1: Foo) -> usize {
44
debug foo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
55
let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
6-
let mut _2: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
6+
let _2: Foo; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
7+
let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
78

89
bb0: {
9-
_2 = discriminant(_1); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
10-
_0 = move _2 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
10+
StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
11+
_2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
12+
_3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
13+
_0 = move _3 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
14+
StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
1115
return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
1216
}
1317
}

0 commit comments

Comments
 (0)