Skip to content

avoid linting ptr_arg if .capacity() is called. #2079

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

Merged
merged 1 commit into from
Sep 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
64 changes: 32 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions clippy_lints/src/literal_digit_grouping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,19 @@ impl LiteralDigitGrouping {
let fractional_part = &parts[1].chars().rev().collect::<String>();
let _ = Self::do_lint(fractional_part)
.map(|fractional_group_size| {
let consistent = Self::parts_consistent(integral_group_size, fractional_group_size, parts[0].len(), parts[1].len());
let consistent = Self::parts_consistent(integral_group_size,
fractional_group_size,
parts[0].len(),
parts[1].len());
if !consistent {
WarningType::InconsistentDigitGrouping.display(&digit_info.grouping_hint(), cx, &lit.span);
WarningType::InconsistentDigitGrouping.display(&digit_info.grouping_hint(),
cx,
&lit.span);
}
})
.map_err(|warning_type| warning_type.display(&digit_info.grouping_hint(), cx, &lit.span));
.map_err(|warning_type| warning_type.display(&digit_info.grouping_hint(),
cx,
&lit.span));
}
})
.map_err(|warning_type| warning_type.display(&digit_info.grouping_hint(), cx, &lit.span));
Expand Down Expand Up @@ -332,7 +339,8 @@ impl LiteralDigitGrouping {
.windows(2)
.all(|ps| ps[1] - ps[0] == group_size + 1)
// number of digits to the left of the last group cannot be bigger than group size.
&& (digits.len() - underscore_positions.last().expect("there's at least one element") <= group_size + 1);
&& (digits.len() - underscore_positions.last()
.expect("there's at least one element") <= group_size + 1);

if !consistent {
return Err(WarningType::InconsistentDigitGrouping);
Expand Down
11 changes: 1 addition & 10 deletions clippy_lints/src/missing_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@
// *rustc*'s
// [`missing_doc`].
//
// [`missing_doc`]:
// https://github.
// com/rust-lang/rust/blob/d6d05904697d89099b55da3331155392f1db9c00/src/librustc_lint/builtin.
//
//
//
//
//
//
// rs#L246
// [`missing_doc`]: https://github.com/rust-lang/rust/blob/d6d05904697d89099b55da3331155392f1db9c00/src/librustc_lint/builtin.rs#L246
//

use rustc::hir;
Expand Down
3 changes: 2 additions & 1 deletion clippy_lints/src/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
else if args.len() == 2 && match_def_path(cx.tcx, fun_id, &paths::FMT_ARGUMENTV1_NEW) {
if let ExprPath(ref qpath) = args[1].node {
if let Some(def_id) = opt_def_id(cx.tables.qpath_def(qpath, args[1].hir_id)) {
if match_def_path(cx.tcx, def_id, &paths::DEBUG_FMT_METHOD) && !is_in_debug_impl(cx, expr) && is_expn_of(expr.span, "panic").is_none() {
if match_def_path(cx.tcx, def_id, &paths::DEBUG_FMT_METHOD)
&& !is_in_debug_impl(cx, expr) && is_expn_of(expr.span, "panic").is_none() {
span_lint(cx, USE_DEBUG, args[0].span, "use of `Debug`-based formatting");
}
}
Expand Down
Loading