mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-29 19:17:12 +00:00 
			
		
		
		
	Merge pull request #20779 from rust-lang/rustc-pull
minor: Rustc pull update
This commit is contained in:
		
						commit
						9d347b0cc7
					
				
					 5 changed files with 9 additions and 11 deletions
				
			
		|  | @ -146,7 +146,7 @@ fn check_size_and_align( | ||||||
| ) { | ) { | ||||||
|     let l = eval_goal(ra_fixture, minicore).unwrap(); |     let l = eval_goal(ra_fixture, minicore).unwrap(); | ||||||
|     assert_eq!(l.size.bytes(), size, "size mismatch"); |     assert_eq!(l.size.bytes(), size, "size mismatch"); | ||||||
|     assert_eq!(l.align.abi.bytes(), align, "align mismatch"); |     assert_eq!(l.align.bytes(), align, "align mismatch"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #[track_caller] | #[track_caller] | ||||||
|  | @ -158,7 +158,7 @@ fn check_size_and_align_expr( | ||||||
| ) { | ) { | ||||||
|     let l = eval_expr(ra_fixture, minicore).unwrap(); |     let l = eval_expr(ra_fixture, minicore).unwrap(); | ||||||
|     assert_eq!(l.size.bytes(), size, "size mismatch"); |     assert_eq!(l.size.bytes(), size, "size mismatch"); | ||||||
|     assert_eq!(l.align.abi.bytes(), align, "align mismatch"); |     assert_eq!(l.align.bytes(), align, "align mismatch"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #[track_caller] | #[track_caller] | ||||||
|  |  | ||||||
|  | @ -2119,7 +2119,7 @@ impl<'db> Evaluator<'db> { | ||||||
|         if let Some(layout) = self.layout_cache.borrow().get(&ty.to_nextsolver(interner)) { |         if let Some(layout) = self.layout_cache.borrow().get(&ty.to_nextsolver(interner)) { | ||||||
|             return Ok(layout |             return Ok(layout | ||||||
|                 .is_sized() |                 .is_sized() | ||||||
|                 .then(|| (layout.size.bytes_usize(), layout.align.abi.bytes() as usize))); |                 .then(|| (layout.size.bytes_usize(), layout.align.bytes() as usize))); | ||||||
|         } |         } | ||||||
|         if let DefWithBodyId::VariantId(f) = locals.body.owner |         if let DefWithBodyId::VariantId(f) = locals.body.owner | ||||||
|             && let Some((AdtId::EnumId(e), _)) = ty.as_adt() |             && let Some((AdtId::EnumId(e), _)) = ty.as_adt() | ||||||
|  | @ -2136,9 +2136,7 @@ impl<'db> Evaluator<'db> { | ||||||
|             return Ok(Some((0, 1))); |             return Ok(Some((0, 1))); | ||||||
|         } |         } | ||||||
|         let layout = layout?; |         let layout = layout?; | ||||||
|         Ok(layout |         Ok(layout.is_sized().then(|| (layout.size.bytes_usize(), layout.align.bytes() as usize))) | ||||||
|             .is_sized() |  | ||||||
|             .then(|| (layout.size.bytes_usize(), layout.align.abi.bytes() as usize))) |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /// A version of `self.size_of` which returns error if the type is unsized. `what` argument should
 |     /// A version of `self.size_of` which returns error if the type is unsized. `what` argument should
 | ||||||
|  | @ -2841,7 +2839,7 @@ impl<'db> Evaluator<'db> { | ||||||
|                     )?; |                     )?; | ||||||
|                     // FIXME: there is some leak here
 |                     // FIXME: there is some leak here
 | ||||||
|                     let size = layout.size.bytes_usize(); |                     let size = layout.size.bytes_usize(); | ||||||
|                     let addr = self.heap_allocate(size, layout.align.abi.bytes() as usize)?; |                     let addr = self.heap_allocate(size, layout.align.bytes() as usize)?; | ||||||
|                     self.write_memory(addr, &result)?; |                     self.write_memory(addr, &result)?; | ||||||
|                     IntervalAndTy { interval: Interval { addr, size }, ty } |                     IntervalAndTy { interval: Interval { addr, size }, ty } | ||||||
|                 }; |                 }; | ||||||
|  |  | ||||||
|  | @ -771,7 +771,7 @@ impl<'db> Evaluator<'db> { | ||||||
|                         "align_of generic arg is not provided".into(), |                         "align_of generic arg is not provided".into(), | ||||||
|                     )); |                     )); | ||||||
|                 }; |                 }; | ||||||
|                 let align = self.layout(ty.to_nextsolver(interner))?.align.abi.bytes(); |                 let align = self.layout(ty.to_nextsolver(interner))?.align.bytes(); | ||||||
|                 destination.write_from_bytes(self, &align.to_le_bytes()[0..destination.size]) |                 destination.write_from_bytes(self, &align.to_le_bytes()[0..destination.size]) | ||||||
|             } |             } | ||||||
|             "size_of_val" => { |             "size_of_val" => { | ||||||
|  | @ -1434,7 +1434,7 @@ impl<'db> Evaluator<'db> { | ||||||
|                     field_types.iter().next_back().unwrap().1.clone().substitute(Interner, subst); |                     field_types.iter().next_back().unwrap().1.clone().substitute(Interner, subst); | ||||||
|                 let sized_part_size = |                 let sized_part_size = | ||||||
|                     layout.fields.offset(field_types.iter().count() - 1).bytes_usize(); |                     layout.fields.offset(field_types.iter().count() - 1).bytes_usize(); | ||||||
|                 let sized_part_align = layout.align.abi.bytes() as usize; |                 let sized_part_align = layout.align.bytes() as usize; | ||||||
|                 let (unsized_part_size, unsized_part_align) = |                 let (unsized_part_size, unsized_part_align) = | ||||||
|                     self.size_align_of_unsized(&last_field_ty, metadata, locals)?; |                     self.size_align_of_unsized(&last_field_ty, metadata, locals)?; | ||||||
|                 let align = sized_part_align.max(unsized_part_align) as isize; |                 let align = sized_part_align.max(unsized_part_align) as isize; | ||||||
|  |  | ||||||
|  | @ -6205,7 +6205,7 @@ impl Layout { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     pub fn align(&self) -> u64 { |     pub fn align(&self) -> u64 { | ||||||
|         self.0.align.abi.bytes() |         self.0.align.bytes() | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     pub fn niches(&self) -> Option<u128> { |     pub fn niches(&self) -> Option<u128> { | ||||||
|  |  | ||||||
|  | @ -1 +1 @@ | ||||||
| f957826bff7a68b267ce75b1ea56352aed0cca0a | 3369e82c6bc03c5cdb66f730dba6f738b74c8e1d | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Laurențiu Nicola
						Laurențiu Nicola