Rollup merge of #91625 - est31:remove_indexes, r=oli-obk

Remove redundant [..]s
This commit is contained in:
Matthias Krüger 2021-12-10 22:40:36 +01:00 committed by GitHub
commit 40988591ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 123 additions and 127 deletions

View file

@ -231,7 +231,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
if let Ok(Some(command)) =
OnUnimplementedDirective::of_item(self.tcx, trait_ref.def_id, def_id)
{
command.evaluate(self.tcx, trait_ref, &flags[..])
command.evaluate(self.tcx, trait_ref, &flags)
} else {
OnUnimplementedNote::default()
}

View file

@ -804,7 +804,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
} else if let ObligationCauseCode::BindingObligation(_, _)
| ObligationCauseCode::ItemObligation(_) = &*code
{
try_borrowing(*poly_trait_ref, &never_suggest_borrow[..])
try_borrowing(*poly_trait_ref, &never_suggest_borrow)
} else {
false
}
@ -1132,7 +1132,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
<https://doc.rust-lang.org/book/ch17-02-trait-objects.html\
#using-trait-objects-that-allow-for-values-of-different-types>";
let has_dyn = snippet.split_whitespace().next().map_or(false, |s| s == "dyn");
let trait_obj = if has_dyn { &snippet[4..] } else { &snippet[..] };
let trait_obj = if has_dyn { &snippet[4..] } else { &snippet };
if only_never_return {
// No return paths, probably using `panic!()` or similar.
// Suggest `-> T`, `-> impl Trait`, and if `Trait` is object safe, `-> Box<dyn Trait>`.