rustc_trait_selection: adopt let else in more places
This commit is contained in:
parent
b8c56fa8c3
commit
dab5c44800
10 changed files with 75 additions and 117 deletions
|
@ -322,11 +322,8 @@ fn trait_has_sized_self(tcx: TyCtxt<'_>, trait_def_id: DefId) -> bool {
|
|||
}
|
||||
|
||||
fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
|
||||
let sized_def_id = match tcx.lang_items().sized_trait() {
|
||||
Some(def_id) => def_id,
|
||||
None => {
|
||||
return false; /* No Sized trait, can't require it! */
|
||||
}
|
||||
let Some(sized_def_id) = tcx.lang_items().sized_trait() else {
|
||||
return false; /* No Sized trait, can't require it! */
|
||||
};
|
||||
|
||||
// Search for a predicate like `Self : Sized` amongst the trait bounds.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue