about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-11 13:06:36 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-11-07 13:58:36 +0100
commit3667e6248ec18740ce57db7997333a30c991929b (patch)
treeec013e9752c766bc2ed4bf4c28b343fe8bf5466c /src/librustc_errors
parent9d6768a478b8a6afa1e16dfebe9d79bd3f508cdf (diff)
downloadrust-3667e6248ec18740ce57db7997333a30c991929b.tar.gz
rust-3667e6248ec18740ce57db7997333a30c991929b.zip
move PResult to librustc_errors
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index 67c180a05e9..fb5cccf61a7 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -15,7 +15,8 @@ use Level::*;
 
 use emitter::{Emitter, EmitterWriter, is_case_difference};
 use registry::Registry;
-
+#[cfg(target_arch = "x86_64")]
+use rustc_data_structures::static_assert_size;
 use rustc_data_structures::sync::{self, Lrc, Lock};
 use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
 use rustc_data_structures::stable_hasher::StableHasher;
@@ -48,6 +49,13 @@ use syntax_pos::{
     SpanSnippetError,
 };
 
+pub type PResult<'a, T> = Result<T, DiagnosticBuilder<'a>>;
+
+// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger.
+// (See also the comment on `DiagnosticBuilderInner`.)
+#[cfg(target_arch = "x86_64")]
+static_assert_size!(PResult<'_, bool>, 16);
+
 /// Indicates the confidence in the correctness of a suggestion.
 ///
 /// All suggestions are marked with an `Applicability`. Tools use the applicability of a suggestion