Auto merge of #71759 - Dylan-DPC:rollup-5hncork, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #71744 (remove obsolete comment) - #71747 (Remove deadcode in eval_mir_constant_to_operand) - #71749 (fix Miri error message padding) - #71752 (make Stability doc a more readable (and fix rustdoc warning)) - #71755 (fix doc reference) Failed merges: r? @ghost
This commit is contained in:
commit
7f65393b9a
@ -119,7 +119,11 @@ pub fn find_unwind_attr(diagnostic: Option<&Handler>, attrs: &[Attribute]) -> Op
|
||||
})
|
||||
}
|
||||
|
||||
/// Represents the #[stable], #[unstable], #[rustc_deprecated] attributes.
|
||||
/// Represents the following attributes:
|
||||
///
|
||||
/// - `#[stable]`
|
||||
/// - `#[unstable]`
|
||||
/// - `#[rustc_deprecated]`
|
||||
#[derive(RustcEncodable, RustcDecodable, Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(HashStable_Generic)]
|
||||
pub struct Stability {
|
||||
@ -128,7 +132,7 @@ pub struct Stability {
|
||||
pub rustc_depr: Option<RustcDeprecation>,
|
||||
}
|
||||
|
||||
/// Represents the #[rustc_const_unstable] and #[rustc_const_stable] attributes.
|
||||
/// Represents the `#[rustc_const_unstable]` and `#[rustc_const_stable]` attributes.
|
||||
#[derive(RustcEncodable, RustcDecodable, Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(HashStable_Generic)]
|
||||
pub struct ConstStability {
|
||||
|
@ -16,25 +16,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
bx: &mut Bx,
|
||||
constant: &mir::Constant<'tcx>,
|
||||
) -> Result<OperandRef<'tcx, Bx::Value>, ErrorHandled> {
|
||||
match constant.literal.val {
|
||||
// Special case unevaluated statics, because statics have an identity and thus should
|
||||
// use `get_static` to get at their id.
|
||||
// FIXME(oli-obk): can we unify this somehow, maybe by making const eval of statics
|
||||
// always produce `&STATIC`. This may also simplify how const eval works with statics.
|
||||
ty::ConstKind::Unevaluated(def_id, substs, None) if self.cx.tcx().is_static(def_id) => {
|
||||
assert!(substs.is_empty(), "we don't support generic statics yet");
|
||||
let static_ = bx.get_static(def_id);
|
||||
// we treat operands referring to statics as if they were `&STATIC` instead
|
||||
let ptr_ty = self.cx.tcx().mk_mut_ptr(self.monomorphize(&constant.literal.ty));
|
||||
let layout = bx.layout_of(ptr_ty);
|
||||
Ok(OperandRef::from_immediate_or_packed_pair(bx, static_, layout))
|
||||
}
|
||||
_ => {
|
||||
let val = self.eval_mir_constant(constant)?;
|
||||
let ty = self.monomorphize(&constant.literal.ty);
|
||||
Ok(OperandRef::from_const(bx, val, ty))
|
||||
}
|
||||
}
|
||||
let val = self.eval_mir_constant(constant)?;
|
||||
let ty = self.monomorphize(&constant.literal.ty);
|
||||
Ok(OperandRef::from_const(bx, val, ty))
|
||||
}
|
||||
|
||||
pub fn eval_mir_constant(
|
||||
|
@ -2050,7 +2050,7 @@ pub struct Param<'hir> {
|
||||
pub struct FnDecl<'hir> {
|
||||
/// The types of the function's parameters.
|
||||
///
|
||||
/// Additional argument data is stored in the function's [body](Body::parameters).
|
||||
/// Additional argument data is stored in the function's [body](Body::params).
|
||||
pub inputs: &'hir [Ty<'hir>],
|
||||
pub output: FnRetTy<'hir>,
|
||||
pub c_variadic: bool,
|
||||
|
@ -147,11 +147,6 @@ impl Constraint<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
/// `VerifyGenericBound(T, _, R, RS)`: the parameter type `T` (or
|
||||
/// associated type) must outlive the region `R`. `T` is known to
|
||||
/// outlive `RS`. Therefore, verify that `R <= RS[i]` for some
|
||||
/// `i`. Inference variables may be involved (but this verification
|
||||
/// step doesn't influence inference).
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Verify<'tcx> {
|
||||
pub kind: GenericKind<'tcx>,
|
||||
@ -687,7 +682,6 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// See [`Verify::VerifyGenericBound`].
|
||||
pub fn verify_generic_bound(
|
||||
&mut self,
|
||||
origin: SubregionOrigin<'tcx>,
|
||||
|
@ -439,10 +439,10 @@ impl fmt::Display for UndefinedBehaviorInfo {
|
||||
DerefFunctionPointer(a) => write!(f, "accessing {} which contains a function", a),
|
||||
ValidationFailure(ref err) => write!(f, "type validation failed: {}", err),
|
||||
InvalidBool(b) => {
|
||||
write!(f, "interpreting an invalid 8-bit value as a bool: 0x{:2x}", b)
|
||||
write!(f, "interpreting an invalid 8-bit value as a bool: 0x{:02x}", b)
|
||||
}
|
||||
InvalidChar(c) => {
|
||||
write!(f, "interpreting an invalid 32-bit value as a char: 0x{:8x}", c)
|
||||
write!(f, "interpreting an invalid 32-bit value as a char: 0x{:08x}", c)
|
||||
}
|
||||
InvalidDiscriminant(val) => write!(f, "enum value has invalid discriminant: {}", val),
|
||||
InvalidFunctionPointer(p) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user