Skip to content

Commit 24de9a1

Browse files
author
bors-servo
authored
Auto merge of #25739 - servo:rustup, r=paulrouget
Upgrade to rustc 1.43.0-nightly (5d04ce67f 2020-02-13) ~This Nightly doesn’t have rustfmt, so merging this PR is blocked on rust-lang/rust#68917 and upgrading to a Nightly with the fix.~ Fixes #25550
2 parents 4f36472 + 708d373 commit 24de9a1

File tree

17 files changed

+53
-67
lines changed

17 files changed

+53
-67
lines changed

Cargo.lock

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/gfx/platform/windows/font.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl FontInfo {
135135
let strings = table.strings().unwrap();
136136
let family = strings[family_index].clone();
137137
let face = strings[face_index].clone();
138-
((family, face))
138+
(family, face)
139139
} else {
140140
return Err(());
141141
}
@@ -145,7 +145,7 @@ impl FontInfo {
145145
let strings = table.strings().unwrap();
146146
let family = strings[family_index].clone();
147147
let face = strings[face_index].clone();
148-
((family, face))
148+
(family, face)
149149
} else {
150150
return Err(());
151151
}

components/layout/fragment.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -944,8 +944,8 @@ impl Fragment {
944944
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_MARGINS,
945945
) {
946946
let margin = style.logical_margin();
947-
(MaybeAuto::from_style(margin.inline_start, Au(0)).specified_or_zero() +
948-
MaybeAuto::from_style(margin.inline_end, Au(0)).specified_or_zero())
947+
MaybeAuto::from_style(margin.inline_start, Au(0)).specified_or_zero() +
948+
MaybeAuto::from_style(margin.inline_end, Au(0)).specified_or_zero()
949949
} else {
950950
Au(0)
951951
};
@@ -957,7 +957,7 @@ impl Fragment {
957957
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_PADDING,
958958
) {
959959
let padding = style.logical_padding();
960-
(padding.inline_start.to_used_value(Au(0)) + padding.inline_end.to_used_value(Au(0)))
960+
padding.inline_start.to_used_value(Au(0)) + padding.inline_end.to_used_value(Au(0))
961961
} else {
962962
Au(0)
963963
};

components/net/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ libflate = "0.1"
3737
log = "0.4"
3838
malloc_size_of = { path = "../malloc_size_of" }
3939
malloc_size_of_derive = "0.1"
40-
matches = "0.1"
4140
mime = "0.3"
4241
mime_guess = "2.0.0-alpha.6"
4342
msg = {path = "../msg"}

components/net/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ extern crate log;
1111
#[macro_use]
1212
extern crate malloc_size_of_derive;
1313
#[macro_use]
14-
extern crate matches;
15-
#[macro_use]
1614
extern crate profile_traits;
1715
#[macro_use]
1816
extern crate serde;

components/script/dom/htmlmediaelement.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2834,7 +2834,7 @@ impl ResourceTimingListener for HTMLMediaElementFetchListener {
28342834
}
28352835

28362836
fn resource_timing_global(&self) -> DomRoot<GlobalScope> {
2837-
(document_from_node(&*self.elem.root()).global())
2837+
document_from_node(&*self.elem.root()).global()
28382838
}
28392839
}
28402840

components/script/dom/htmlscriptelement.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ impl ResourceTimingListener for ClassicContext {
309309
}
310310

311311
fn resource_timing_global(&self) -> DomRoot<GlobalScope> {
312-
(document_from_node(&*self.elem.root()).global())
312+
document_from_node(&*self.elem.root()).global()
313313
}
314314
}
315315

components/script_plugins/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@ plugin = true
1111

1212
[features]
1313
unrooted_must_root_lint = []
14-
15-
[dependencies]
16-
matches = "0.1"

components/script_plugins/lib.rs

+39-35
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#![feature(rustc_private)]
2020
#![cfg(feature = "unrooted_must_root_lint")]
2121

22-
#[macro_use]
23-
extern crate matches;
2422
extern crate rustc;
2523
extern crate rustc_driver;
2624
extern crate rustc_hir;
@@ -204,12 +202,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
204202
for ref field in def.fields() {
205203
let def_id = cx.tcx.hir().local_def_id(field.hir_id);
206204
if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) {
207-
cx.span_lint(
208-
UNROOTED_MUST_ROOT,
209-
field.span,
210-
"Type must be rooted, use #[unrooted_must_root_lint::must_root] \
211-
on the struct definition to propagate",
212-
)
205+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
206+
lint.build(
207+
"Type must be rooted, use #[unrooted_must_root_lint::must_root] \
208+
on the struct definition to propagate",
209+
)
210+
.set_span(field.span)
211+
.emit()
212+
})
213213
}
214214
}
215215
}
@@ -226,12 +226,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
226226
for field in fields {
227227
let def_id = cx.tcx.hir().local_def_id(field.hir_id);
228228
if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) {
229-
cx.span_lint(
230-
UNROOTED_MUST_ROOT,
231-
field.ty.span,
232-
"Type must be rooted, use #[unrooted_must_root_lint::must_root] on \
233-
the enum definition to propagate",
234-
)
229+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
230+
lint.build(
231+
"Type must be rooted, \
232+
use #[unrooted_must_root_lint::must_root] \
233+
on the enum definition to propagate",
234+
)
235+
.set_span(field.ty.span)
236+
.emit()
237+
})
235238
}
236239
}
237240
},
@@ -262,17 +265,19 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
262265

263266
for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) {
264267
if is_unrooted_ty(&self.symbols, cx, ty, false) {
265-
cx.span_lint(UNROOTED_MUST_ROOT, arg.span, "Type must be rooted")
268+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
269+
lint.build("Type must be rooted").set_span(arg.span).emit()
270+
})
266271
}
267272
}
268273

269274
if !in_new_function {
270275
if is_unrooted_ty(&self.symbols, cx, sig.output().skip_binder(), false) {
271-
cx.span_lint(
272-
UNROOTED_MUST_ROOT,
273-
decl.output.span(),
274-
"Type must be rooted",
275-
)
276+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
277+
lint.build("Type must be rooted")
278+
.set_span(decl.output.span())
279+
.emit()
280+
})
276281
}
277282
}
278283
}
@@ -301,11 +306,11 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> {
301306
let require_rooted = |cx: &LateContext, in_new_function: bool, subexpr: &hir::Expr| {
302307
let ty = cx.tables.expr_ty(&subexpr);
303308
if is_unrooted_ty(&self.symbols, cx, ty, in_new_function) {
304-
cx.span_lint(
305-
UNROOTED_MUST_ROOT,
306-
subexpr.span,
307-
&format!("Expression of type {:?} must be rooted", ty),
308-
)
309+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
310+
lint.build(&format!("Expression of type {:?} must be rooted", ty))
311+
.set_span(subexpr.span)
312+
.emit()
313+
})
309314
}
310315
};
311316

@@ -343,11 +348,11 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> {
343348
hir::PatKind::Binding(hir::BindingAnnotation::Mutable, ..) => {
344349
let ty = cx.tables.pat_ty(pat);
345350
if is_unrooted_ty(&self.symbols, cx, ty, self.in_new_function) {
346-
cx.span_lint(
347-
UNROOTED_MUST_ROOT,
348-
pat.span,
349-
&format!("Expression of type {:?} must be rooted", ty),
350-
)
351+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
352+
lint.build(&format!("Expression of type {:?} must be rooted", ty))
353+
.set_span(pat.span)
354+
.emit()
355+
})
351356
}
352357
},
353358
_ => {},
@@ -388,11 +393,10 @@ fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool {
388393
}
389394

390395
fn in_derive_expn(span: Span) -> bool {
391-
if let ExpnKind::Macro(MacroKind::Attr, n) = span.ctxt().outer_expn_data().kind {
392-
n.as_str().contains("derive")
393-
} else {
394-
false
395-
}
396+
matches!(
397+
span.ctxt().outer_expn_data().kind,
398+
ExpnKind::Macro(MacroKind::Derive, _)
399+
)
396400
}
397401

398402
macro_rules! symbols {

components/selectors/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ bench = []
2121

2222
[dependencies]
2323
bitflags = "1.0"
24-
matches = "0.1"
2524
cssparser = "0.27"
2625
derive_more = "0.99"
2726
log = "0.4"

components/selectors/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ extern crate derive_more;
1414
extern crate fxhash;
1515
#[macro_use]
1616
extern crate log;
17-
#[macro_use]
18-
extern crate matches;
1917
extern crate phf;
2018
extern crate precomputed_hash;
2119
extern crate servo_arc;

components/style/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ lazy_static = "1"
5050
log = { version = "0.4", features = ["std"] }
5151
malloc_size_of = { path = "../malloc_size_of" }
5252
malloc_size_of_derive = "0.1"
53-
matches = "0.1"
5453
num_cpus = {version = "1.1.0"}
5554
num-integer = "0.1"
5655
num-traits = "0.2"

components/style/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ extern crate log;
6161
extern crate malloc_size_of;
6262
#[macro_use]
6363
extern crate malloc_size_of_derive;
64-
#[allow(unused_extern_crates)]
65-
#[macro_use]
66-
extern crate matches;
6764
#[cfg(feature = "gecko")]
6865
pub extern crate nsstring;
6966
#[cfg(feature = "gecko")]

components/style/stylesheet_set.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ macro_rules! sheet_set_methods {
388388
guard: &SharedRwLockReadGuard,
389389
) {
390390
if let Some(device) = device {
391-
self.invalidations.collect_invalidations_for(device, sheet, guard);
391+
self.invalidations
392+
.collect_invalidations_for(device, sheet, guard);
392393
}
393394
}
394395

@@ -435,7 +436,7 @@ macro_rules! sheet_set_methods {
435436
let collection = self.collection_for(&sheet, guard);
436437
collection.remove(&sheet)
437438
}
438-
}
439+
};
439440
}
440441

441442
impl<S> DocumentStylesheetSet<S>

components/style/values/computed/length.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ macro_rules! computed_length_percentage_or_auto {
8080
generics::GenericLengthPercentageOrAuto::Auto => None,
8181
generics::GenericLengthPercentageOrAuto::LengthPercentage(ref lp) => {
8282
Some(lp.to_used_value(percentage_basis))
83-
}
83+
},
8484
}
8585
}
8686

@@ -93,7 +93,7 @@ macro_rules! computed_length_percentage_or_auto {
9393
Auto => false,
9494
}
9595
}
96-
}
96+
};
9797
}
9898

9999
/// A computed type for `<length-percentage> | auto`.

components/style/values/specified/font.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ macro_rules! system_font_methods {
6161
None
6262
}
6363
}
64-
}
64+
};
6565
}
6666

6767
const DEFAULT_SCRIPT_MIN_SIZE_PT: u32 = 8;

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2020-01-16
1+
nightly-2020-02-14

0 commit comments

Comments
 (0)