layout computation: eagerly error for unexpected unsized fields
This commit is contained in:
@@ -26,7 +26,7 @@ mod layout;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
pub use layout::LayoutCalculator;
|
||||
pub use layout::{LayoutCalculator, LayoutCalculatorError};
|
||||
|
||||
/// Requirements for a `StableHashingContext` to be used in this crate.
|
||||
/// This is a hack to allow using the `HashStable_Generic` derive macro
|
||||
@@ -393,6 +393,14 @@ impl HasDataLayout for TargetDataLayout {
|
||||
}
|
||||
}
|
||||
|
||||
// used by rust-analyzer
|
||||
impl HasDataLayout for &TargetDataLayout {
|
||||
#[inline]
|
||||
fn data_layout(&self) -> &TargetDataLayout {
|
||||
(**self).data_layout()
|
||||
}
|
||||
}
|
||||
|
||||
/// Endianness of the target, which must match cfg(target-endian).
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
pub enum Endian {
|
||||
|
||||
Reference in New Issue
Block a user