]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_build/src/check_unsafety.rs
Rollup merge of #103920 - ferrocene:pa-maybe-open-in-browser, r=jyn514
[rust.git] / compiler / rustc_mir_build / src / check_unsafety.rs
index 5e8ce65daf0fc451ae750d10923c5bdbe7fdb17c..fb1ea9ed300ad4f8c87a02d6c32718c614ceca21 100644 (file)
@@ -260,7 +260,7 @@ fn visit_pat(&mut self, pat: &Pat<'tcx>) {
                     };
                     match borrow_kind {
                         BorrowKind::Shallow | BorrowKind::Shared | BorrowKind::Unique => {
-                            if !ty.is_freeze(self.tcx.at(pat.span), self.param_env) {
+                            if !ty.is_freeze(self.tcx, self.param_env) {
                                 self.requires_unsafe(pat.span, BorrowOfLayoutConstrainedField);
                             }
                         }
@@ -457,9 +457,7 @@ fn visit_expr(&mut self, expr: &Expr<'tcx>) {
                 if visitor.found {
                     match borrow_kind {
                         BorrowKind::Shallow | BorrowKind::Shared | BorrowKind::Unique
-                            if !self.thir[arg]
-                                .ty
-                                .is_freeze(self.tcx.at(self.thir[arg].span), self.param_env) =>
+                            if !self.thir[arg].ty.is_freeze(self.tcx, self.param_env) =>
                         {
                             self.requires_unsafe(expr.span, BorrowOfLayoutConstrainedField)
                         }