Skip to content

Commit cf8143b

Browse files
authored
Auto merge of #27619 - servo:rustup, r=jdm
Upgrade to rustc 1.48.0-nightly (623fb90b5 2020-09-26) rust-lang/hashbrown#159 reduced `size_of::<HashMap>()`
2 parents 9a6ae55 + ee74a64 commit cf8143b

File tree

5 files changed

+28
-19
lines changed

5 files changed

+28
-19
lines changed

components/script_plugins/lib.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function
110110
continue;
111111
},
112112
};
113-
let recur_into_subtree = match t.kind {
113+
let recur_into_subtree = match t.kind() {
114114
ty::Adt(did, substs) => {
115115
let has_attr = |did, name| has_lint_attr(sym, &cx.tcx.get_attrs(did), name);
116116
if has_attr(did.did, sym.must_root) {
@@ -121,7 +121,7 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function
121121
} else if match_def_path(cx, did.did, &[sym.alloc, sym.rc, sym.Rc]) {
122122
// Rc<Promise> is okay
123123
let inner = substs.type_at(0);
124-
if let ty::Adt(did, _) = inner.kind {
124+
if let ty::Adt(did, _) = inner.kind() {
125125
if has_attr(did.did, sym.allow_unrooted_in_rc) {
126126
false
127127
} else {
@@ -132,8 +132,12 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function
132132
}
133133
} else if match_def_path(cx, did.did, &[sym::core, sym.cell, sym.Ref]) ||
134134
match_def_path(cx, did.did, &[sym::core, sym.cell, sym.RefMut]) ||
135-
match_def_path(cx, did.did, &[sym::core, sym.slice, sym.Iter]) ||
136-
match_def_path(cx, did.did, &[sym::core, sym.slice, sym.IterMut]) ||
135+
match_def_path(cx, did.did, &[sym::core, sym::slice, sym::iter, sym.Iter]) ||
136+
match_def_path(
137+
cx,
138+
did.did,
139+
&[sym::core, sym::slice, sym::iter, sym.IterMut],
140+
) ||
137141
match_def_path(cx, did.did, &[sym.accountable_refcell, sym.Ref]) ||
138142
match_def_path(cx, did.did, &[sym.accountable_refcell, sym.RefMut]) ||
139143
match_def_path(
@@ -383,13 +387,14 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> {
383387
/// usage e.g. with
384388
/// `match_def_path(cx, id, &["core", "option", "Option"])`
385389
fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool {
386-
let krate = &cx.tcx.crate_name(def_id.krate);
390+
let def_path = cx.tcx.def_path(def_id);
391+
let krate = &cx.tcx.crate_name(def_path.krate);
387392
if krate != &path[0] {
388393
return false;
389394
}
390395

391396
let path = &path[1..];
392-
let other = cx.tcx.def_path(def_id).data;
397+
let other = def_path.data;
393398

394399
if other.len() != path.len() {
395400
return false;
@@ -398,7 +403,7 @@ fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool {
398403
other
399404
.into_iter()
400405
.zip(path)
401-
.all(|(e, p)| e.data.as_symbol() == *p)
406+
.all(|(e, p)| e.data.get_opt_name().as_ref() == Some(p))
402407
}
403408

404409
fn in_derive_expn(span: Span) -> bool {
@@ -438,7 +443,6 @@ symbols! {
438443
accountable_refcell
439444
Ref
440445
RefMut
441-
slice
442446
Iter
443447
IterMut
444448
collections

python/servo/command_base.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,12 @@ def ensure_bootstrapped(self, target=None, rustup_components=None):
10281028

10291029
def ensure_rustup_version(self):
10301030
try:
1031-
version_line = subprocess.check_output(["rustup" + BIN_SUFFIX, "--version"])
1031+
version_line = subprocess.check_output(
1032+
["rustup" + BIN_SUFFIX, "--version"],
1033+
# Silence "info: This is the version for the rustup toolchain manager,
1034+
# not the rustc compiler."
1035+
stderr=open(os.devnull, "wb")
1036+
)
10321037
except OSError as e:
10331038
if e.errno == NO_SUCH_FILE_OR_DIRECTORY:
10341039
print("It looks like rustup is not installed. See instructions at "

python/servo/packages.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"openssl": "111.3.0+1.1.1c-vs2017-2019-09-18",
1212
"gstreamer-uwp": "1.16.0.5",
1313
"openxr-loader-uwp": "1.0",
14-
"xargo": "v0.3.17",
14+
"xargo": "v0.3.22",
1515
}

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2020-07-27
1+
nightly-2020-09-27

tests/unit/script/size_of.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ macro_rules! sizeof_checker (
2929
);
3030

3131
// Update the sizes here
32-
sizeof_checker!(size_event_target, EventTarget, 56);
33-
sizeof_checker!(size_node, Node, 192);
34-
sizeof_checker!(size_element, Element, 368);
35-
sizeof_checker!(size_htmlelement, HTMLElement, 384);
36-
sizeof_checker!(size_div, HTMLDivElement, 384);
37-
sizeof_checker!(size_span, HTMLSpanElement, 384);
38-
sizeof_checker!(size_text, Text, 224);
39-
sizeof_checker!(size_characterdata, CharacterData, 224);
32+
sizeof_checker!(size_event_target, EventTarget, 48);
33+
sizeof_checker!(size_node, Node, 184);
34+
sizeof_checker!(size_element, Element, 360);
35+
sizeof_checker!(size_htmlelement, HTMLElement, 376);
36+
sizeof_checker!(size_div, HTMLDivElement, 376);
37+
sizeof_checker!(size_span, HTMLSpanElement, 376);
38+
sizeof_checker!(size_text, Text, 216);
39+
sizeof_checker!(size_characterdata, CharacterData, 216);

0 commit comments

Comments
 (0)