mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-11-03 13:13:18 +00:00 
			
		
		
		
	Auto merge of #144440 - matthiaskrgr:rollup-peb88gb, r=matthiaskrgr
Rollup of 12 pull requests Successful merges: - rust-lang/rust#142569 (Suggest clone in user-write-code instead of inside macro) - rust-lang/rust#143401 (tests: Don't check for self-printed output in std-backtrace.rs test) - rust-lang/rust#143424 (clippy fix: rely on autoderef) - rust-lang/rust#143970 (Update core::mem::copy documentation) - rust-lang/rust#143979 (Test fixes for Arm64EC Windows) - rust-lang/rust#144200 (Tweak output for non-`Clone` values moved into closures) - rust-lang/rust#144209 (Don't emit two `assume`s in transmutes when one is a subset of the other) - rust-lang/rust#144314 (Hint that choose_pivot returns index in bounds) - rust-lang/rust#144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`) - rust-lang/rust#144368 (resolve: Remove `Scope::CrateRoot`) - rust-lang/rust#144390 (Remove dead code and extend test coverage and diagnostics around it) - rust-lang/rust#144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
		
						commit
						c2c1ab178b
					
				@ -3,9 +3,9 @@
 | 
				
			|||||||
use std::{cmp, ops::Bound};
 | 
					use std::{cmp, ops::Bound};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use hir_def::{
 | 
					use hir_def::{
 | 
				
			||||||
    AdtId, VariantId,
 | 
					 | 
				
			||||||
    layout::{Integer, ReprOptions, TargetDataLayout},
 | 
					    layout::{Integer, ReprOptions, TargetDataLayout},
 | 
				
			||||||
    signatures::{StructFlags, VariantFields},
 | 
					    signatures::{StructFlags, VariantFields},
 | 
				
			||||||
 | 
					    AdtId, VariantId,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
use intern::sym;
 | 
					use intern::sym;
 | 
				
			||||||
use rustc_index::IndexVec;
 | 
					use rustc_index::IndexVec;
 | 
				
			||||||
@ -13,9 +13,9 @@ use smallvec::SmallVec;
 | 
				
			|||||||
use triomphe::Arc;
 | 
					use triomphe::Arc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use crate::{
 | 
					use crate::{
 | 
				
			||||||
    Substitution, TraitEnvironment,
 | 
					 | 
				
			||||||
    db::HirDatabase,
 | 
					    db::HirDatabase,
 | 
				
			||||||
    layout::{Layout, LayoutError, field_ty},
 | 
					    layout::{field_ty, Layout, LayoutError},
 | 
				
			||||||
 | 
					    Substitution, TraitEnvironment,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use super::LayoutCx;
 | 
					use super::LayoutCx;
 | 
				
			||||||
@ -85,16 +85,6 @@ pub fn layout_of_adt_query(
 | 
				
			|||||||
                let d = db.const_eval_discriminant(e.enum_variants(db).variants[id.0].0).ok()?;
 | 
					                let d = db.const_eval_discriminant(e.enum_variants(db).variants[id.0].0).ok()?;
 | 
				
			||||||
                Some((id, d))
 | 
					                Some((id, d))
 | 
				
			||||||
            }),
 | 
					            }),
 | 
				
			||||||
            // FIXME: The current code for niche-filling relies on variant indices
 | 
					 | 
				
			||||||
            // instead of actual discriminants, so enums with
 | 
					 | 
				
			||||||
            // explicit discriminants (RFC #2363) would misbehave and we should disable
 | 
					 | 
				
			||||||
            // niche optimization for them.
 | 
					 | 
				
			||||||
            // The code that do it in rustc:
 | 
					 | 
				
			||||||
            // repr.inhibit_enum_layout_opt() || def
 | 
					 | 
				
			||||||
            //     .variants()
 | 
					 | 
				
			||||||
            //     .iter_enumerated()
 | 
					 | 
				
			||||||
            //     .any(|(i, v)| v.discr != ty::VariantDiscr::Relative(i.as_u32()))
 | 
					 | 
				
			||||||
            repr.inhibit_enum_layout_opt(),
 | 
					 | 
				
			||||||
            !matches!(def, AdtId::EnumId(..))
 | 
					            !matches!(def, AdtId::EnumId(..))
 | 
				
			||||||
                && variants
 | 
					                && variants
 | 
				
			||||||
                    .iter()
 | 
					                    .iter()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user