Auto merge of #121549 - matthiaskrgr:rollup-1hvu3lb, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #121435 (Account for RPITIT in E0310 explicit lifetime constraint suggestion) - #121490 (Rustdoc: include crate name in links for local primitives) - #121520 (delay cloning of iterator items) - #121522 (check that simd_insert/extract indices are in-bounds) - #121531 (Ignore less tests in debug builds) - #121539 (compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid unnecessary large move) - #121542 (update stdarch) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
381d69953b
76 changed files with 189 additions and 152 deletions
|
@ -2437,6 +2437,14 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
let suggestion =
|
||||
if has_lifetimes { format!(" + {lt_name}") } else { format!(": {lt_name}") };
|
||||
suggs.push((sp, suggestion))
|
||||
} else if let GenericKind::Alias(ref p) = bound_kind
|
||||
&& let ty::Projection = p.kind(self.tcx)
|
||||
&& let DefKind::AssocTy = self.tcx.def_kind(p.def_id)
|
||||
&& let Some(ty::ImplTraitInTraitData::Trait { .. }) =
|
||||
self.tcx.opt_rpitit_info(p.def_id)
|
||||
{
|
||||
// The lifetime found in the `impl` is longer than the one on the RPITIT.
|
||||
// Do not suggest `<Type as Trait>::{opaque}: 'static`.
|
||||
} else if let Some(generics) = self.tcx.hir().get_generics(suggestion_scope) {
|
||||
let pred = format!("{bound_kind}: {lt_name}");
|
||||
let suggestion = format!("{} {}", generics.add_where_or_trailing_comma(), pred);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue