Auto merge of #103290 - matthiaskrgr:rollup-ngozai3, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #103197 (Stabilize proc_macro::Span::source_text) - #103251 (Fix item declaration highlighting) - #103262 (Adjusting test to needs-unwind, with linking issue) - #103268 (rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`) - #103272 (Remove extra spaces in docs) - #103276 (Erase regions before checking for `Default` in uninitialized binding error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
542febd2d3
10 changed files with 191 additions and 38 deletions
|
@ -492,10 +492,17 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
let Some(default_trait) = tcx.get_diagnostic_item(sym::Default) else {
|
||||
return false;
|
||||
};
|
||||
// Regions are already solved, so we must use a fresh InferCtxt,
|
||||
// but the type has region variables, so erase those.
|
||||
tcx.infer_ctxt()
|
||||
.build()
|
||||
.type_implements_trait(default_trait, ty, ty::List::empty(), param_env)
|
||||
.may_apply()
|
||||
.type_implements_trait(
|
||||
default_trait,
|
||||
tcx.erase_regions(ty),
|
||||
ty::List::empty(),
|
||||
param_env,
|
||||
)
|
||||
.must_apply_modulo_regions()
|
||||
};
|
||||
|
||||
let assign_value = match ty.kind() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue