8000 Rollup of 8 pull requests by JohnTitor · Pull Request #69730 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 8 pull requests #69730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
80ed505
Use single-char patter on {ends,starts}_with and remove clone on copy…
matthiaskrgr Mar 4, 2020
bb126e1
Rollup merge of #69520 - kornelski:e69492, r=cramertj
JohnTitor Mar 5, 2020
273c5b2
Rollup merge of #69614 - estebank:ice-age, r=davidtwco
JohnTitor Mar 5, 2020
6178e2b
Rollup merge of #69641 - ehuss:update-books, r=ehuss
JohnTitor Mar 5, 2020
8a4419a
Rollup merge of #69697 - GuillaumeGomez:explanation-e0380, r=Dylan-DPC
JohnTitor Mar 5, 2020
6000a57
Rollup merge of #69698 - RalfJung:int_assoc, r=davidtwco
JohnTitor Mar 5, 2020
ab496fe
Rollup merge of #69705 - ehuss:toolstate-remove-redundant-beta, r=Mar…
JohnTitor Mar 5, 2020
61b68f1
Rollup merge of #69711 - penelopezone:patch-1, r=steveklabnik
JohnTitor Mar 5, 2020
3219fdd
Rollup merge of #69713 - matthiaskrgr:more_cleanup, r=cramertj
JohnTitor Mar 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use .map() to modify data inside Options instead of using .and_then(|…
…x| Some(y)) (clippy::option_and_then_some)
  • Loading branch information
matthiaskrgr committed Mar 4, 2020
commit 569676b9b05cd150da3dadcd886cbbf5b40c4fce
6 changes: 3 additions & 3 deletions src/librustc/traits/structural_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> {
super::ReferenceOutlivesReferent(ty) => {
tcx.lift(&ty).map(super::ReferenceOutlivesReferent)
}
super::ObjectTypeBound(ty, r) => tcx
.lift(&ty)
.and_then(|ty| tcx.lift(&r).and_then(|r| Some(super::ObjectTypeBound(ty, r)))),
super::ObjectTypeBound(ty, r) => {
tcx.lift(&ty).and_then(|ty| tcx.lift(&r).map(|r| super::ObjectTypeBound(ty, r)))
}
super::ObjectCastObligation(ty) => tcx.lift(&ty).map(super::ObjectCastObligation),
super::Coercion { source, target } => {
Some(super::Coercion { source: tcx.lift(&source)?, target: tcx.lift(&target)? })
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_parse/parser/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<'a> Parser<'a> {
let inner_parse_policy = InnerAttributeParsePolicy::NotPermitted {
reason: inner_error_reason,
saw_doc_comment: just_parsed_doc_comment,
prev_attr_sp: attrs.last().and_then(|a| Some(a.span)),
prev_attr_sp: attrs.last().map(|a| a.span),
};
let attr = self.parse_attribute_with_inner_parse_policy(inner_parse_policy)?;
attrs.push(attr);
Expand Down
27 changes: 12 additions & 15 deletions src/librustc_typeck/check/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1551,21 +1551,18 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {

let method_names = pcx.candidate_method_names();
pcx.allow_similar_names = false;
let applicable_close_candidates: Vec<ty::AssocItem> =
method_names
.iter()
.filter_map(|&method_name| {
pcx.reset();
pcx.method_name = Some(method_name);
pcx.assemble_inherent_candidates();
pcx.assemble_extension_candidates_for_traits_in_scope(hir::DUMMY_HIR_ID)
.map_or(None, |_| {
pcx.pick_core()
.and_then(|pick| pick.ok())
.and_then(|pick| Some(pick.item))
})
})
.collect();
let applicable_close_candidates: Vec<ty::AssocItem> = method_names
.iter()
.filter_map(|&method_name| {
pcx.reset();
pcx.method_name = Some(method_name);
pcx.assemble_inherent_candidates();
pcx.assemble_extension_candidates_for_traits_in_scope(hir::DUMMY_HIR_ID)
.map_or(None, |_| {
pcx.pick_core().and_then(|pick| pick.ok()).map(|pick| pick.item)
})
})
.collect();

if applicable_close_candidates.is_empty() {
Ok(None)
Expand Down
4 changes: 1 addition & 3 deletions src/librustdoc/clean/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ pub fn external_generic_args(
let args: Vec<_> = substs
.iter()
.filter_map(|kind| match kind.unpack() {
GenericArgKind::Lifetime(lt) => {
lt.clean(cx).and_then(|lt| Some(GenericArg::Lifetime(lt)))
}
GenericArgKind::Lifetime(lt) => lt.clean(cx).map(|lt| GenericArg::Lifetime(lt)),
GenericArgKind::Type(_) if skip_self => {
skip_self = false;
None
Expand Down
0