]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/thir.rs
Rollup merge of #106762 - WaffleLapkin:atomicptr+as_mut_ptr, r=m-ou-se
[rust.git] / compiler / rustc_middle / src / thir.rs
index ac903010c8d31bba0e158db5016516709d3b5b38..5f320708c8416944466a25137159b95386baee11 100644 (file)
@@ -9,6 +9,7 @@
 //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/thir.html
 
 use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
+use rustc_errors::{DiagnosticArgValue, IntoDiagnosticArg};
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_hir::RangeEnd;
@@ -575,6 +576,12 @@ pub fn simple_ident(&self) -> Option<Symbol> {
     }
 }
 
+impl<'tcx> IntoDiagnosticArg for Pat<'tcx> {
+    fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
+        format!("{}", self).into_diagnostic_arg()
+    }
+}
+
 #[derive(Clone, Debug, HashStable)]
 pub struct Ascription<'tcx> {
     pub annotation: CanonicalUserTypeAnnotation<'tcx>,