Auto merge of #133261 - matthiaskrgr:rollup-ekui4we, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #129838 (uefi: process: Add args support) - #130800 (Mark `get_mut` and `set_position` in `std::io::Cursor` as const.) - #132708 (Point at `const` definition when used instead of a binding in a `let` statement) - #133226 (Make `PointerLike` opt-in instead of built-in) - #133244 (Account for `wasm32v1-none` when exporting TLS symbols) - #133257 (Add `UnordMap::clear` method) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
2d0ea7956c
51 changed files with 627 additions and 266 deletions
|
@ -656,7 +656,7 @@ impl<'tcx> Pat<'tcx> {
|
|||
| Binding { subpattern: Some(subpattern), .. }
|
||||
| Deref { subpattern }
|
||||
| DerefPattern { subpattern, .. }
|
||||
| InlineConstant { subpattern, .. } => subpattern.walk_(it),
|
||||
| ExpandedConstant { subpattern, .. } => subpattern.walk_(it),
|
||||
Leaf { subpatterns } | Variant { subpatterns, .. } => {
|
||||
subpatterns.iter().for_each(|field| field.pattern.walk_(it))
|
||||
}
|
||||
|
@ -799,12 +799,17 @@ pub enum PatKind<'tcx> {
|
|||
value: mir::Const<'tcx>,
|
||||
},
|
||||
|
||||
/// Inline constant found while lowering a pattern.
|
||||
InlineConstant {
|
||||
/// [LocalDefId] of the constant, we need this so that we have a
|
||||
/// Pattern obtained by converting a constant (inline or named) to its pattern
|
||||
/// representation using `const_to_pat`.
|
||||
ExpandedConstant {
|
||||
/// [DefId] of the constant, we need this so that we have a
|
||||
/// reference that can be used by unsafety checking to visit nested
|
||||
/// unevaluated constants.
|
||||
def: LocalDefId,
|
||||
/// unevaluated constants and for diagnostics. If the `DefId` doesn't
|
||||
/// correspond to a local crate, it points at the `const` item.
|
||||
def_id: DefId,
|
||||
/// If `false`, then `def_id` points at a `const` item, otherwise it
|
||||
/// corresponds to a local inline const.
|
||||
is_inline: bool,
|
||||
/// If the inline constant is used in a range pattern, this subpattern
|
||||
/// represents the range (if both ends are inline constants, there will
|
||||
/// be multiple InlineConstant wrappers).
|
||||
|
|
|
@ -247,7 +247,7 @@ pub fn walk_pat<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>(
|
|||
}
|
||||
}
|
||||
Constant { value: _ } => {}
|
||||
InlineConstant { def: _, subpattern } => visitor.visit_pat(subpattern),
|
||||
ExpandedConstant { def_id: _, is_inline: _, subpattern } => visitor.visit_pat(subpattern),
|
||||
Range(_) => {}
|
||||
Slice { prefix, slice, suffix } | Array { prefix, slice, suffix } => {
|
||||
for subpattern in prefix.iter() {
|
||||
|
|
|
@ -602,19 +602,6 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
|
|||
self.coroutine_is_async_gen(coroutine_def_id)
|
||||
}
|
||||
|
||||
// We don't use `TypingEnv` here as it's only defined in `rustc_middle` and
|
||||
// `rustc_next_trait_solver` shouldn't have to know about it.
|
||||
fn layout_is_pointer_like(
|
||||
self,
|
||||
typing_mode: ty::TypingMode<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
) -> bool {
|
||||
let typing_env = ty::TypingEnv { typing_mode, param_env };
|
||||
self.layout_of(self.erase_regions(typing_env).as_query_input(self.erase_regions(ty)))
|
||||
.is_ok_and(|layout| layout.layout.is_pointer_like(&self.data_layout))
|
||||
}
|
||||
|
||||
type UnsizingParams = &'tcx rustc_index::bit_set::BitSet<u32>;
|
||||
fn unsizing_params_for_adt(self, adt_def_id: DefId) -> Self::UnsizingParams {
|
||||
self.unsizing_params_for_adt(adt_def_id)
|
||||
|
@ -688,7 +675,6 @@ bidirectional_lang_item_map! {
|
|||
Metadata,
|
||||
Option,
|
||||
PointeeTrait,
|
||||
PointerLike,
|
||||
Poll,
|
||||
Sized,
|
||||
TransmuteTrait,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue