Skip to content

Commit 6840920

Browse files
Hmikihirosagudev
authored andcommitted
Update to rust 1.80.0 (servo#32896)
* Update for nix Signed-off-by: Hayashi Mikihiro <[email protected]> * Update to Rust 1.80.0 Signed-off-by: Hayashi Mikihiro <[email protected]> * Rename to BindingMode from BindingAnnotation rust-lang/rust#124047 Signed-off-by: Hayashi Mikihiro <[email protected]> * Remove TypeVariableOriginKind rust-lang/rust#123016 Signed-off-by: Hayashi Mikihiro <[email protected]> * Remove TypeVariableOrigin rust-lang/rust#124955 Signed-off-by: Hayashi Mikihiro <[email protected]> * Remove LintDiagnostic::msg rust-lang/rust#125410 Signed-off-by: Hayashi Mikihiro <[email protected]> * common.rs fmt mistake indents Signed-off-by: Hayashi Mikihiro <[email protected]> * trace_in_no_trace.rs remove mistake space Signed-off-by: Hayashi Mikihiro <[email protected]> * trace_in_no_trace.rs remove mistake head space Signed-off-by: Hayashi Mikihiro <[email protected]> * Workaround for servo#32912 It's dirty but it worked on 2000 runs Signed-off-by: sagudev <[email protected]> --------- Signed-off-by: Hayashi Mikihiro <[email protected]> Signed-off-by: sagudev <[email protected]> Co-authored-by: Samson <[email protected]>
1 parent ce20ab9 commit 6840920

File tree

6 files changed

+44
-58
lines changed

6 files changed

+44
-58
lines changed

components/net/tests/resource_thread.rs

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ fn test_exit() {
3535
);
3636
resource_thread.send(CoreResourceMsg::Exit(sender)).unwrap();
3737
receiver.recv().unwrap();
38+
// Workaround for https://github.com/servo/servo/issues/32912
39+
#[cfg(windows)]
40+
std::thread::sleep(std::time::Duration::from_millis(100));
3841
}
3942

4043
#[test]

etc/shell.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ with import (builtins.fetchTarball {
1010
overlays = [
1111
(import (builtins.fetchTarball {
1212
# Bumped the channel in rust-toolchain.toml? Bump this commit too!
13-
url = "https://github.com/oxalica/rust-overlay/archive/7f0e3ef7b7fbed78e12e5100851175d28af4b7c6.tar.gz";
13+
url = "https://github.com/oxalica/rust-overlay/archive/8b81b8ed00b20fd57b24adcb390bd96ea81ecd90.tar.gz";
1414
}))
1515
];
1616
config = {

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[toolchain]
22
# Be sure to update etc/shell.nix when bumping this!
3-
channel = "1.78.0"
3+
channel = "1.80.0"
44

55
components = [
66
# For support/crown

support/crown/src/common.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use rustc_ast::Mutability;
66
use rustc_hir::def::{DefKind, Res};
77
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
88
use rustc_hir::{ImplItemRef, ItemKind, Node, OwnerId, PrimTy, TraitItemRef};
9-
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
109
use rustc_infer::infer::TyCtxtInferExt;
1110
use rustc_lint::LateContext;
1211
use rustc_middle::ty::fast_reject::SimplifiedType;
@@ -338,14 +337,10 @@ pub fn implements_trait_with_env<'tcx>(
338337
return false;
339338
}
340339
let infcx = tcx.infer_ctxt().build();
341-
let orig = TypeVariableOrigin {
342-
kind: TypeVariableOriginKind::MiscVariable,
343-
span: DUMMY_SP,
344-
};
345340
let ty_params = tcx.mk_args_from_iter(
346341
ty_params
347342
.into_iter()
348-
.map(|arg| arg.unwrap_or_else(|| infcx.next_ty_var(orig).into())),
343+
.map(|arg| arg.unwrap_or_else(|| infcx.next_ty_var(DUMMY_SP).into())),
349344
);
350345
infcx
351346
.type_implements_trait(

support/crown/src/trace_in_no_trace.rs

+9-15
Original file line numberDiff line numberDiff line change
@@ -131,24 +131,18 @@ fn incorrect_no_trace<'tcx, I: Into<MultiSpan> + Copy>(
131131
{
132132
let inner = substs.type_at(pos);
133133
if inner.is_primitive_ty() {
134-
cx.lint(
135-
EMPTY_TRACE_IN_NO_TRACE,
136-
EMPTY_TRACE_IN_NO_TRACE_MSG,
137-
|lint| {
138-
lint.span(span);
139-
},
140-
)
134+
cx.lint(EMPTY_TRACE_IN_NO_TRACE, |lint| {
135+
lint.primary_message(EMPTY_TRACE_IN_NO_TRACE_MSG);
136+
lint.span(span);
137+
})
141138
} else if is_jstraceable(cx, inner) {
142-
cx.lint(
143-
TRACE_IN_NO_TRACE,
144-
format!(
139+
cx.lint(TRACE_IN_NO_TRACE, |lint| {
140+
lint.primary_message(format!(
145141
"must_not_have_traceable marked wrapper must not have \
146142
jsmanaged inside on {pos}-th position. Consider removing the wrapper."
147-
),
148-
|lint| {
149-
lint.span(span);
150-
},
151-
)
143+
));
144+
lint.span(span);
145+
})
152146
}
153147
false
154148
} else {

support/crown/src/unrooted_must_root.rs

+29-35
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,13 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
187187
for field in def.fields() {
188188
let field_type = cx.tcx.type_of(field.def_id);
189189
if is_unrooted_ty(&self.symbols, cx, field_type.skip_binder(), false) {
190-
cx.lint(
191-
UNROOTED_MUST_ROOT,
192-
"Type must be rooted, use #[crown::unrooted_must_root_lint::must_root] \
193-
on the struct definition to propagate",
194-
|lint| {
195-
lint.span(field.span);
196-
},
197-
)
190+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
191+
lint.primary_message(
192+
"Type must be rooted, use #[crown::unrooted_must_root_lint::must_root] \
193+
on the struct definition to propagate"
194+
);
195+
lint.span(field.span);
196+
})
198197
}
199198
}
200199
}
@@ -212,15 +211,14 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
212211
for field in fields {
213212
let field_type = cx.tcx.type_of(field.def_id);
214213
if is_unrooted_ty(&self.symbols, cx, field_type.skip_binder(), false) {
215-
cx.lint(
216-
UNROOTED_MUST_ROOT,
217-
"Type must be rooted, \
218-
use #[crown::unrooted_must_root_lint::must_root] \
219-
on the enum definition to propagate",
220-
|lint| {
221-
lint.span(field.ty.span);
222-
},
223-
)
214+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
215+
lint.primary_message(
216+
"Type must be rooted, \
217+
use #[crown::unrooted_must_root_lint::must_root] \
218+
on the enum definition to propagate",
219+
);
220+
lint.span(field.ty.span);
221+
})
224222
}
225223
}
226224
},
@@ -250,7 +248,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
250248

251249
for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) {
252250
if is_unrooted_ty(&self.symbols, cx, *ty, false) {
253-
cx.lint(UNROOTED_MUST_ROOT, "Type must be rooted", |lint| {
251+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
252+
lint.primary_message("Type must be rooted");
254253
lint.span(arg.span);
255254
})
256255
}
@@ -259,7 +258,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
259258
if !in_new_function &&
260259
is_unrooted_ty(&self.symbols, cx, sig.output().skip_binder(), false)
261260
{
262-
cx.lint(UNROOTED_MUST_ROOT, "Type must be rooted", |lint| {
261+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
262+
lint.primary_message("Type must be rooted");
263263
lint.span(decl.output.span());
264264
})
265265
}
@@ -289,13 +289,10 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> {
289289
let require_rooted = |cx: &LateContext, in_new_function: bool, subexpr: &hir::Expr| {
290290
let ty = cx.typeck_results().expr_ty(subexpr);
291291
if is_unrooted_ty(self.symbols, cx, ty, in_new_function) {
292-
cx.lint(
293-
UNROOTED_MUST_ROOT,
294-
format!("Expression of type {:?} must be rooted", ty),
295-
|lint| {
296-
lint.span(subexpr.span);
297-
},
298-
)
292+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
293+
lint.primary_message(format!("Expression of type {:?} must be rooted", ty));
294+
lint.span(subexpr.span);
295+
})
299296
}
300297
};
301298

@@ -329,17 +326,14 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> {
329326
// are implemented, the `Unannotated` case could cause false-positives.
330327
// These should be fixable by adding an explicit `ref`.
331328
match pat.kind {
332-
hir::PatKind::Binding(hir::BindingAnnotation::NONE, ..) |
333-
hir::PatKind::Binding(hir::BindingAnnotation::MUT, ..) => {
329+
hir::PatKind::Binding(hir::BindingMode::NONE, ..) |
330+
hir::PatKind::Binding(hir::BindingMode::MUT, ..) => {
334331
let ty = cx.typeck_results().pat_ty(pat);
335332
if is_unrooted_ty(self.symbols, cx, ty, self.in_new_function) {
336-
cx.lint(
337-
UNROOTED_MUST_ROOT,
338-
format!("Expression of type {:?} must be rooted", ty),
339-
|lint| {
340-
lint.span(pat.span);
341-
},
342-
)
333+
cx.lint(UNROOTED_MUST_ROOT, |lint| {
334+
lint.primary_message(format!("Expression of type {:?} must be rooted", ty));
335+
lint.span(pat.span);
336+
})
343337
}
344338
},
345339
_ => {},

0 commit comments

Comments
 (0)