Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f005c74

Browse files
committedNov 28, 2024·
Auto merge of rust-lang#133561 - GuillaumeGomez:rollup-g4upmv4, r=GuillaumeGomez
Rollup of 12 pull requests Successful merges: - rust-lang#129409 (Expand std::os::unix::fs::chown() doc with a warning) - rust-lang#133320 (Add release notes for Rust 1.83.0) - rust-lang#133368 (Delay a bug when encountering an impl with unconstrained generics in `codegen_select`) - rust-lang#133428 (Actually use placeholder regions for trait method late bound regions in `collect_return_position_impl_trait_in_trait_tys`) - rust-lang#133512 (Add `as_array` and `as_mut_array` conversion methods to slices.) - rust-lang#133519 (Check `xform_ret_ty` for WF in the new solver to improve method winnowing) - rust-lang#133520 (Structurally resolve before applying projection in borrowck) - rust-lang#133534 (extend group-forbid-always-trumps-cli test) - rust-lang#133537 ([rustdoc] Fix new clippy lints) - rust-lang#133543 ([AIX] create shim for lgammaf_r) - rust-lang#133547 (rustc_span: Replace a `HashMap<_, ()>` with `HashSet`) - rust-lang#133550 (print generated doc paths) r? `@ghost` `@rustbot` modify labels: rollup
2 parents eddb717 + ed913fe commit f005c74

File tree

86 files changed

+1023
-440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1023
-440
lines changed
 

‎RELEASES.md

Lines changed: 233 additions & 1 deletion
Large diffs are not rendered by default.

‎compiler/rustc_borrowck/src/type_check/canonical.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use rustc_middle::mir::ConstraintCategory;
77
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, Upcast};
88
use rustc_span::Span;
99
use rustc_span::def_id::DefId;
10+
use rustc_trait_selection::solve::NoSolution;
1011
use rustc_trait_selection::traits::ObligationCause;
1112
use rustc_trait_selection::traits::query::type_op::custom::CustomTypeOp;
1213
use rustc_trait_selection::traits::query::type_op::{self, TypeOpOutput};
@@ -177,6 +178,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
177178
if self.infcx.next_trait_solver() {
178179
let body = self.body;
179180
let param_env = self.infcx.param_env;
181+
// FIXME: Make this into a real type op?
180182
self.fully_perform_op(
181183
location.to_locations(),
182184
ConstraintCategory::Boring,
@@ -213,6 +215,40 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
213215
}
214216
}
215217

218+
#[instrument(skip(self), level = "debug")]
219+
pub(super) fn structurally_resolve(
220+
&mut self,
221+
ty: Ty<'tcx>,
222+
location: impl NormalizeLocation,
223+
) -> Ty<'tcx> {
224+
if self.infcx.next_trait_solver() {
225+
let body = self.body;
226+
let param_env = self.infcx.param_env;
227+
// FIXME: Make this into a real type op?
228+
self.fully_perform_op(
229+
location.to_locations(),
230+
ConstraintCategory::Boring,
231+
CustomTypeOp::new(
232+
|ocx| {
233+
ocx.structurally_normalize(
234+
&ObligationCause::misc(
235+
location.to_locations().span(body),
236+
body.source.def_id().expect_local(),
237+
),
238+
param_env,
239+
ty,
240+
)
241+
.map_err(|_| NoSolution)
242+
},
243+
"normalizing struct tail",
244+
),
245+
)
246+
.unwrap_or_else(|guar| Ty::new_error(self.tcx(), guar))
247+
} else {
248+
self.normalize(ty, location)
249+
}
250+
}
251+
216252
#[instrument(skip(self), level = "debug")]
217253
pub(super) fn ascribe_user_type(
218254
&mut self,

0 commit comments

Comments
 (0)
This repository has been archived.