diff options
-rw-r--r-- | components/gfx/platform/windows/font.rs | 4 | ||||
-rw-r--r-- | components/layout/fragment.rs | 6 | ||||
-rw-r--r-- | components/script/dom/htmlmediaelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmlscriptelement.rs | 2 | ||||
-rw-r--r-- | components/script_plugins/lib.rs | 72 | ||||
-rw-r--r-- | components/style/stylesheet_set.rs | 5 | ||||
-rw-r--r-- | components/style/values/computed/length.rs | 4 | ||||
-rw-r--r-- | components/style/values/specified/font.rs | 2 | ||||
-rw-r--r-- | rust-toolchain | 2 |
9 files changed, 53 insertions, 46 deletions
diff --git a/components/gfx/platform/windows/font.rs b/components/gfx/platform/windows/font.rs index 7ee36b91aa8..b933bdfb975 100644 --- a/components/gfx/platform/windows/font.rs +++ b/components/gfx/platform/windows/font.rs @@ -135,7 +135,7 @@ impl FontInfo { let strings = table.strings().unwrap(); let family = strings[family_index].clone(); let face = strings[face_index].clone(); - ((family, face)) + (family, face) } else { return Err(()); } @@ -145,7 +145,7 @@ impl FontInfo { let strings = table.strings().unwrap(); let family = strings[family_index].clone(); let face = strings[face_index].clone(); - ((family, face)) + (family, face) } else { return Err(()); } diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index c0240f72071..ef1c6227a0a 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -944,8 +944,8 @@ impl Fragment { QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_MARGINS, ) { let margin = style.logical_margin(); - (MaybeAuto::from_style(margin.inline_start, Au(0)).specified_or_zero() + - MaybeAuto::from_style(margin.inline_end, Au(0)).specified_or_zero()) + MaybeAuto::from_style(margin.inline_start, Au(0)).specified_or_zero() + + MaybeAuto::from_style(margin.inline_end, Au(0)).specified_or_zero() } else { Au(0) }; @@ -957,7 +957,7 @@ impl Fragment { QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_PADDING, ) { let padding = style.logical_padding(); - (padding.inline_start.to_used_value(Au(0)) + padding.inline_end.to_used_value(Au(0))) + padding.inline_start.to_used_value(Au(0)) + padding.inline_end.to_used_value(Au(0)) } else { Au(0) }; diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index e8cd7737a2e..d9b0f11beef 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -2834,7 +2834,7 @@ impl ResourceTimingListener for HTMLMediaElementFetchListener { } fn resource_timing_global(&self) -> DomRoot<GlobalScope> { - (document_from_node(&*self.elem.root()).global()) + document_from_node(&*self.elem.root()).global() } } diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 74773bad36b..66a2cddc777 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -309,7 +309,7 @@ impl ResourceTimingListener for ClassicContext { } fn resource_timing_global(&self) -> DomRoot<GlobalScope> { - (document_from_node(&*self.elem.root()).global()) + document_from_node(&*self.elem.root()).global() } } diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs index 9ad7ae8502d..035ce326480 100644 --- a/components/script_plugins/lib.rs +++ b/components/script_plugins/lib.rs @@ -202,12 +202,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass { for ref field in def.fields() { let def_id = cx.tcx.hir().local_def_id(field.hir_id); if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) { - cx.span_lint( - UNROOTED_MUST_ROOT, - field.span, - "Type must be rooted, use #[unrooted_must_root_lint::must_root] \ - on the struct definition to propagate", - ) + cx.lint(UNROOTED_MUST_ROOT, |lint| { + lint.build( + "Type must be rooted, use #[unrooted_must_root_lint::must_root] \ + on the struct definition to propagate", + ) + .set_span(field.span) + .emit() + }) } } } @@ -224,12 +226,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass { for field in fields { let def_id = cx.tcx.hir().local_def_id(field.hir_id); if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) { - cx.span_lint( - UNROOTED_MUST_ROOT, - field.ty.span, - "Type must be rooted, use #[unrooted_must_root_lint::must_root] on \ - the enum definition to propagate", - ) + cx.lint(UNROOTED_MUST_ROOT, |lint| { + lint.build( + "Type must be rooted, \ + use #[unrooted_must_root_lint::must_root] \ + on the enum definition to propagate", + ) + .set_span(field.ty.span) + .emit() + }) } } }, @@ -260,17 +265,19 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass { for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) { if is_unrooted_ty(&self.symbols, cx, ty, false) { - cx.span_lint(UNROOTED_MUST_ROOT, arg.span, "Type must be rooted") + cx.lint(UNROOTED_MUST_ROOT, |lint| { + lint.build("Type must be rooted").set_span(arg.span).emit() + }) } } if !in_new_function { if is_unrooted_ty(&self.symbols, cx, sig.output().skip_binder(), false) { - cx.span_lint( - UNROOTED_MUST_ROOT, - decl.output.span(), - "Type must be rooted", - ) + cx.lint(UNROOTED_MUST_ROOT, |lint| { + lint.build("Type must be rooted") + .set_span(decl.output.span()) + .emit() + }) } } } @@ -299,11 +306,11 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> { let require_rooted = |cx: &LateContext, in_new_function: bool, subexpr: &hir::Expr| { let ty = cx.tables.expr_ty(&subexpr); if is_unrooted_ty(&self.symbols, cx, ty, in_new_function) { - cx.span_lint( - UNROOTED_MUST_ROOT, - subexpr.span, - &format!("Expression of type {:?} must be rooted", ty), - ) + cx.lint(UNROOTED_MUST_ROOT, |lint| { + lint.build(&format!("Expression of type {:?} must be rooted", ty)) + .set_span(subexpr.span) + .emit() + }) } }; @@ -341,11 +348,11 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> { hir::PatKind::Binding(hir::BindingAnnotation::Mutable, ..) => { let ty = cx.tables.pat_ty(pat); if is_unrooted_ty(&self.symbols, cx, ty, self.in_new_function) { - cx.span_lint( - UNROOTED_MUST_ROOT, - pat.span, - &format!("Expression of type {:?} must be rooted", ty), - ) + cx.lint(UNROOTED_MUST_ROOT, |lint| { + lint.build(&format!("Expression of type {:?} must be rooted", ty)) + .set_span(pat.span) + .emit() + }) } }, _ => {}, @@ -386,11 +393,10 @@ fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool { } fn in_derive_expn(span: Span) -> bool { - if let ExpnKind::Macro(MacroKind::Attr, n) = span.ctxt().outer_expn_data().kind { - n.as_str().contains("derive") - } else { - false - } + matches!( + span.ctxt().outer_expn_data().kind, + ExpnKind::Macro(MacroKind::Derive, _) + ) } macro_rules! symbols { diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index d8c21d5494c..cca08c9d233 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -388,7 +388,8 @@ macro_rules! sheet_set_methods { guard: &SharedRwLockReadGuard, ) { if let Some(device) = device { - self.invalidations.collect_invalidations_for(device, sheet, guard); + self.invalidations + .collect_invalidations_for(device, sheet, guard); } } @@ -435,7 +436,7 @@ macro_rules! sheet_set_methods { let collection = self.collection_for(&sheet, guard); collection.remove(&sheet) } - } + }; } impl<S> DocumentStylesheetSet<S> diff --git a/components/style/values/computed/length.rs b/components/style/values/computed/length.rs index eedd05d1f15..68a944fafff 100644 --- a/components/style/values/computed/length.rs +++ b/components/style/values/computed/length.rs @@ -80,7 +80,7 @@ macro_rules! computed_length_percentage_or_auto { generics::GenericLengthPercentageOrAuto::Auto => None, generics::GenericLengthPercentageOrAuto::LengthPercentage(ref lp) => { Some(lp.to_used_value(percentage_basis)) - } + }, } } @@ -93,7 +93,7 @@ macro_rules! computed_length_percentage_or_auto { Auto => false, } } - } + }; } /// A computed type for `<length-percentage> | auto`. diff --git a/components/style/values/specified/font.rs b/components/style/values/specified/font.rs index 84c5141ed92..f7823e5f9ff 100644 --- a/components/style/values/specified/font.rs +++ b/components/style/values/specified/font.rs @@ -61,7 +61,7 @@ macro_rules! system_font_methods { None } } - } + }; } const DEFAULT_SCRIPT_MIN_SIZE_PT: u32 = 8; diff --git a/rust-toolchain b/rust-toolchain index 20d9cdab46e..b17bee1216c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-01-16 +nightly-2020-02-14 |