-
Notifications
You must be signed in to change notification settings - Fork 13k
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
compiler: clippy::complexity fixes #121523
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -555,9 +555,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |
{ | ||
let args = self.infcx.fresh_args_for_item(call_name.span, assoc.def_id); | ||
let fn_sig = tcx.fn_sig(assoc.def_id).instantiate(tcx, args); | ||
let fn_sig = | ||
self.instantiate_binder_with_fresh_vars(call_name.span, FnCall, fn_sig); | ||
Some((assoc, fn_sig)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this entire
|
||
|
||
self.instantiate_binder_with_fresh_vars(call_name.span, FnCall, fn_sig); | ||
} | ||
None | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,7 +139,7 @@ pub trait Printer<'tcx>: Sized { | |
_, | ||
hir::CoroutineSource::Closure, | ||
)) = self.tcx().coroutine_kind(def_id) | ||
&& args.len() >= parent_args.len() + 1 | ||
&& args.len() > parent_args.len() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wtf |
||
{ | ||
return self.path_generic_args( | ||
|cx| cx.print_def_path(def_id, parent_args), | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1264,7 +1264,7 @@ fn validate_commandline_args_with_session_available(sess: &Session) { | |||||
// LLVM CFI using rustc LTO requires a single codegen unit. | ||||||
if sess.is_sanitizer_cfi_enabled() | ||||||
&& sess.lto() == config::Lto::Fat | ||||||
&& !(sess.codegen_units().as_usize() == 1) | ||||||
&& (sess.codegen_units().as_usize() != 1) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. amazing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Why doesn't the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the lint avoids triggering when mixed-precedence operators are involved because it can be useful to clarify them explicitly. here it's a bit silly though, yeah. |
||||||
{ | ||||||
sess.dcx().emit_err(errors::SanitizerCfiRequiresSingleCodegenUnit); | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1031,12 +1031,9 @@ fn assemble_candidates_from_impls<'cx, 'tcx>( | |
{ | ||
candidate_set.mark_ambiguous(); | ||
true | ||
} else if obligation.predicate.args.type_at(0).to_opt_closure_kind().is_some() | ||
&& obligation.predicate.args.type_at(1).to_opt_closure_kind().is_some() | ||
{ | ||
true | ||
} else { | ||
false | ||
obligation.predicate.args.type_at(0).to_opt_closure_kind().is_some() | ||
Comment on lines
-1034
to
+1035
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure whether this is really better 🤷 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alone yes, but in an |
||
&& obligation.predicate.args.type_at(1).to_opt_closure_kind().is_some() | ||
} | ||
} else if lang_items.discriminant_kind_trait() == Some(trait_ref.def_id) { | ||
match self_ty.kind() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cx
andsp
were only used in recursion and thus removedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow that's a cool lint!