diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-11-04 12:48:51 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-04 10:17:36 +0100 |
| commit | 081c49783f5cfc24f66f3ac36244d816567cc120 (patch) | |
| tree | 5b5418b5ffcc0e8847024e2f4eddaa87ab57b6df /src/librustc_mir/transform | |
| parent | c4a850078cbcc8cd3d79483b51767f1171d81f88 (diff) | |
| download | rust-081c49783f5cfc24f66f3ac36244d816567cc120.tar.gz rust-081c49783f5cfc24f66f3ac36244d816567cc120.zip | |
generalize the message about the creation of layout restricted types
Diffstat (limited to 'src/librustc_mir/transform')
| -rw-r--r-- | src/librustc_mir/transform/check_unsafety.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_mir/transform/check_unsafety.rs b/src/librustc_mir/transform/check_unsafety.rs index 05052c8a8c8..2a80f27ecab 100644 --- a/src/librustc_mir/transform/check_unsafety.rs +++ b/src/librustc_mir/transform/check_unsafety.rs @@ -144,8 +144,8 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> { (Bound::Unbounded, Bound::Unbounded) => {}, _ => self.require_unsafe( "initializing type with `rustc_layout_scalar_valid_range` attr", - "initializing `NonZero` with a `0` violates layout constraints \ - and is undefined behavior", + "initializing a layout restricted type's field with a value outside \ + the valid range is undefined behavior", UnsafetyViolationKind::MinConstFn, ), } |
