diff options
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/error.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/syntax.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/instance.rs | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/error.rs b/compiler/rustc_middle/src/error.rs index 61348cdce23..5c2aa0005d4 100644 --- a/compiler/rustc_middle/src/error.rs +++ b/compiler/rustc_middle/src/error.rs @@ -160,7 +160,7 @@ pub struct TypeLengthLimit { pub span: Span, pub shrunk: String, #[note(middle_written_to_path)] - pub was_written: Option<()>, + pub was_written: bool, pub path: PathBuf, pub type_length: usize, } diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs index 51b4154ddab..748ca047754 100644 --- a/compiler/rustc_middle/src/mir/syntax.rs +++ b/compiler/rustc_middle/src/mir/syntax.rs @@ -395,7 +395,7 @@ pub enum StatementKind<'tcx> { /// `PlaceMention(PLACE)`. /// /// When executed at runtime, this computes the given place, but then discards - /// it without doing a load. It is UB if the place is not pointing to live memory. + /// it without doing a load. `let _ = *ptr;` is fine even if the pointer is dangling. PlaceMention(Box<Place<'tcx>>), /// Encodes a user's type ascription. These need to be preserved diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs index 6f19739de45..ecb3943e788 100644 --- a/compiler/rustc_middle/src/ty/instance.rs +++ b/compiler/rustc_middle/src/ty/instance.rs @@ -581,9 +581,9 @@ impl<'tcx> Instance<'tcx> { let mut path = PathBuf::new(); let was_written = if let Some(path2) = written_to_path { path = path2; - Some(()) + true } else { - None + false }; tcx.dcx().emit_fatal(error::TypeLengthLimit { // We don't use `def_span(def_id)` so that diagnostics point |
