diff options
| author | bors <bors@rust-lang.org> | 2023-05-22 20:33:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-22 20:33:51 +0000 |
| commit | 8b4b20836b832e91aa605a2faf5e2a55190202c8 (patch) | |
| tree | 2f39d24e87501b8f6b75c8dd7581125958154eb2 /compiler/rustc_trait_selection/src/traits | |
| parent | cfcde247cd9ff23c193f520b4930ccedffa584b2 (diff) | |
| parent | ec372a17e2f588334b77efa1dc8d4bc7758121e3 (diff) | |
| download | rust-8b4b20836b832e91aa605a2faf5e2a55190202c8.tar.gz rust-8b4b20836b832e91aa605a2faf5e2a55190202c8.zip | |
Auto merge of #111848 - Dylan-DPC:rollup-7jqydzg, r=Dylan-DPC
Rollup of 6 pull requests
Successful merges:
- #111501 (MIR drive-by cleanups)
- #111609 (Mark internal functions and traits unsafe to reflect preconditions)
- #111612 (Give better error when collecting into `&[T]`)
- #111756 (Rename `{drop,forget}_{copy,ref}` lints to more consistent naming)
- #111843 (move lcnr to only review types stuff)
- #111844 (Migrate GUI colors test to original CSS color format)
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs index 88525e1b720..10bd027b684 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs @@ -306,6 +306,14 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { } } } + + // `&[{integral}]` - `FromIterator` needs that. + if let ty::Ref(_, ref_ty, rustc_ast::Mutability::Not) = self_ty.kind() + && let ty::Slice(sty) = ref_ty.kind() + && sty.is_integral() + { + flags.push((sym::_Self, Some("&[{integral}]".to_owned()))); + } }); if let Ok(Some(command)) = OnUnimplementedDirective::of_item(self.tcx, def_id) { |
