mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update to rust 1.80.0 (#32896)
* Update for nix Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Update to Rust 1.80.0 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Rename to BindingMode from BindingAnnotation https://github.com/rust-lang/rust/pull/124047 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Remove TypeVariableOriginKind https://github.com/rust-lang/rust/pull/123016 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Remove TypeVariableOrigin https://github.com/rust-lang/rust/pull/124955 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Remove LintDiagnostic::msg rust-lang/rust#125410 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * common.rs fmt mistake indents Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * trace_in_no_trace.rs remove mistake space Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * trace_in_no_trace.rs remove mistake head space Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * Workaround for https://github.com/servo/servo/issues/32912 It's dirty but it worked on 2000 runs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
a3f588832b
commit
3c271fb298
6 changed files with 44 additions and 58 deletions
|
@ -35,6 +35,9 @@ fn test_exit() {
|
||||||
);
|
);
|
||||||
resource_thread.send(CoreResourceMsg::Exit(sender)).unwrap();
|
resource_thread.send(CoreResourceMsg::Exit(sender)).unwrap();
|
||||||
receiver.recv().unwrap();
|
receiver.recv().unwrap();
|
||||||
|
// Workaround for https://github.com/servo/servo/issues/32912
|
||||||
|
#[cfg(windows)]
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -10,7 +10,7 @@ with import (builtins.fetchTarball {
|
||||||
overlays = [
|
overlays = [
|
||||||
(import (builtins.fetchTarball {
|
(import (builtins.fetchTarball {
|
||||||
# Bumped the channel in rust-toolchain.toml? Bump this commit too!
|
# Bumped the channel in rust-toolchain.toml? Bump this commit too!
|
||||||
url = "https://github.com/oxalica/rust-overlay/archive/7f0e3ef7b7fbed78e12e5100851175d28af4b7c6.tar.gz";
|
url = "https://github.com/oxalica/rust-overlay/archive/8b81b8ed00b20fd57b24adcb390bd96ea81ecd90.tar.gz";
|
||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
# Be sure to update etc/shell.nix when bumping this!
|
# Be sure to update etc/shell.nix when bumping this!
|
||||||
channel = "1.78.0"
|
channel = "1.80.0"
|
||||||
|
|
||||||
components = [
|
components = [
|
||||||
# For support/crown
|
# For support/crown
|
||||||
|
|
|
@ -6,7 +6,6 @@ use rustc_ast::Mutability;
|
||||||
use rustc_hir::def::{DefKind, Res};
|
use rustc_hir::def::{DefKind, Res};
|
||||||
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
|
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
|
||||||
use rustc_hir::{ImplItemRef, ItemKind, Node, OwnerId, PrimTy, TraitItemRef};
|
use rustc_hir::{ImplItemRef, ItemKind, Node, OwnerId, PrimTy, TraitItemRef};
|
||||||
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
|
|
||||||
use rustc_infer::infer::TyCtxtInferExt;
|
use rustc_infer::infer::TyCtxtInferExt;
|
||||||
use rustc_lint::LateContext;
|
use rustc_lint::LateContext;
|
||||||
use rustc_middle::ty::fast_reject::SimplifiedType;
|
use rustc_middle::ty::fast_reject::SimplifiedType;
|
||||||
|
@ -338,14 +337,10 @@ pub fn implements_trait_with_env<'tcx>(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let infcx = tcx.infer_ctxt().build();
|
let infcx = tcx.infer_ctxt().build();
|
||||||
let orig = TypeVariableOrigin {
|
|
||||||
kind: TypeVariableOriginKind::MiscVariable,
|
|
||||||
span: DUMMY_SP,
|
|
||||||
};
|
|
||||||
let ty_params = tcx.mk_args_from_iter(
|
let ty_params = tcx.mk_args_from_iter(
|
||||||
ty_params
|
ty_params
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|arg| arg.unwrap_or_else(|| infcx.next_ty_var(orig).into())),
|
.map(|arg| arg.unwrap_or_else(|| infcx.next_ty_var(DUMMY_SP).into())),
|
||||||
);
|
);
|
||||||
infcx
|
infcx
|
||||||
.type_implements_trait(
|
.type_implements_trait(
|
||||||
|
|
|
@ -131,24 +131,18 @@ fn incorrect_no_trace<'tcx, I: Into<MultiSpan> + Copy>(
|
||||||
{
|
{
|
||||||
let inner = substs.type_at(pos);
|
let inner = substs.type_at(pos);
|
||||||
if inner.is_primitive_ty() {
|
if inner.is_primitive_ty() {
|
||||||
cx.lint(
|
cx.lint(EMPTY_TRACE_IN_NO_TRACE, |lint| {
|
||||||
EMPTY_TRACE_IN_NO_TRACE,
|
lint.primary_message(EMPTY_TRACE_IN_NO_TRACE_MSG);
|
||||||
EMPTY_TRACE_IN_NO_TRACE_MSG,
|
lint.span(span);
|
||||||
|lint| {
|
})
|
||||||
lint.span(span);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
} else if is_jstraceable(cx, inner) {
|
} else if is_jstraceable(cx, inner) {
|
||||||
cx.lint(
|
cx.lint(TRACE_IN_NO_TRACE, |lint| {
|
||||||
TRACE_IN_NO_TRACE,
|
lint.primary_message(format!(
|
||||||
format!(
|
|
||||||
"must_not_have_traceable marked wrapper must not have \
|
"must_not_have_traceable marked wrapper must not have \
|
||||||
jsmanaged inside on {pos}-th position. Consider removing the wrapper."
|
jsmanaged inside on {pos}-th position. Consider removing the wrapper."
|
||||||
),
|
));
|
||||||
|lint| {
|
lint.span(span);
|
||||||
lint.span(span);
|
})
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -187,14 +187,13 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
|
||||||
for field in def.fields() {
|
for field in def.fields() {
|
||||||
let field_type = cx.tcx.type_of(field.def_id);
|
let field_type = cx.tcx.type_of(field.def_id);
|
||||||
if is_unrooted_ty(&self.symbols, cx, field_type.skip_binder(), false) {
|
if is_unrooted_ty(&self.symbols, cx, field_type.skip_binder(), false) {
|
||||||
cx.lint(
|
cx.lint(UNROOTED_MUST_ROOT, |lint| {
|
||||||
UNROOTED_MUST_ROOT,
|
lint.primary_message(
|
||||||
"Type must be rooted, use #[crown::unrooted_must_root_lint::must_root] \
|
"Type must be rooted, use #[crown::unrooted_must_root_lint::must_root] \
|
||||||
on the struct definition to propagate",
|
on the struct definition to propagate"
|
||||||
|lint| {
|
);
|
||||||
lint.span(field.span);
|
lint.span(field.span);
|
||||||
},
|
})
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,15 +211,14 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
|
||||||
for field in fields {
|
for field in fields {
|
||||||
let field_type = cx.tcx.type_of(field.def_id);
|
let field_type = cx.tcx.type_of(field.def_id);
|
||||||
if is_unrooted_ty(&self.symbols, cx, field_type.skip_binder(), false) {
|
if is_unrooted_ty(&self.symbols, cx, field_type.skip_binder(), false) {
|
||||||
cx.lint(
|
cx.lint(UNROOTED_MUST_ROOT, |lint| {
|
||||||
UNROOTED_MUST_ROOT,
|
lint.primary_message(
|
||||||
"Type must be rooted, \
|
"Type must be rooted, \
|
||||||
use #[crown::unrooted_must_root_lint::must_root] \
|
use #[crown::unrooted_must_root_lint::must_root] \
|
||||||
on the enum definition to propagate",
|
on the enum definition to propagate",
|
||||||
|lint| {
|
);
|
||||||
lint.span(field.ty.span);
|
lint.span(field.ty.span);
|
||||||
},
|
})
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -250,7 +248,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
|
||||||
|
|
||||||
for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) {
|
for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) {
|
||||||
if is_unrooted_ty(&self.symbols, cx, *ty, false) {
|
if is_unrooted_ty(&self.symbols, cx, *ty, false) {
|
||||||
cx.lint(UNROOTED_MUST_ROOT, "Type must be rooted", |lint| {
|
cx.lint(UNROOTED_MUST_ROOT, |lint| {
|
||||||
|
lint.primary_message("Type must be rooted");
|
||||||
lint.span(arg.span);
|
lint.span(arg.span);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -259,7 +258,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
|
||||||
if !in_new_function &&
|
if !in_new_function &&
|
||||||
is_unrooted_ty(&self.symbols, cx, sig.output().skip_binder(), false)
|
is_unrooted_ty(&self.symbols, cx, sig.output().skip_binder(), false)
|
||||||
{
|
{
|
||||||
cx.lint(UNROOTED_MUST_ROOT, "Type must be rooted", |lint| {
|
cx.lint(UNROOTED_MUST_ROOT, |lint| {
|
||||||
|
lint.primary_message("Type must be rooted");
|
||||||
lint.span(decl.output.span());
|
lint.span(decl.output.span());
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -289,13 +289,10 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> {
|
||||||
let require_rooted = |cx: &LateContext, in_new_function: bool, subexpr: &hir::Expr| {
|
let require_rooted = |cx: &LateContext, in_new_function: bool, subexpr: &hir::Expr| {
|
||||||
let ty = cx.typeck_results().expr_ty(subexpr);
|
let ty = cx.typeck_results().expr_ty(subexpr);
|
||||||
if is_unrooted_ty(self.symbols, cx, ty, in_new_function) {
|
if is_unrooted_ty(self.symbols, cx, ty, in_new_function) {
|
||||||
cx.lint(
|
cx.lint(UNROOTED_MUST_ROOT, |lint| {
|
||||||
UNROOTED_MUST_ROOT,
|
lint.primary_message(format!("Expression of type {:?} must be rooted", ty));
|
||||||
format!("Expression of type {:?} must be rooted", ty),
|
lint.span(subexpr.span);
|
||||||
|lint| {
|
})
|
||||||
lint.span(subexpr.span);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -329,17 +326,14 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> {
|
||||||
// are implemented, the `Unannotated` case could cause false-positives.
|
// are implemented, the `Unannotated` case could cause false-positives.
|
||||||
// These should be fixable by adding an explicit `ref`.
|
// These should be fixable by adding an explicit `ref`.
|
||||||
match pat.kind {
|
match pat.kind {
|
||||||
hir::PatKind::Binding(hir::BindingAnnotation::NONE, ..) |
|
hir::PatKind::Binding(hir::BindingMode::NONE, ..) |
|
||||||
hir::PatKind::Binding(hir::BindingAnnotation::MUT, ..) => {
|
hir::PatKind::Binding(hir::BindingMode::MUT, ..) => {
|
||||||
let ty = cx.typeck_results().pat_ty(pat);
|
let ty = cx.typeck_results().pat_ty(pat);
|
||||||
if is_unrooted_ty(self.symbols, cx, ty, self.in_new_function) {
|
if is_unrooted_ty(self.symbols, cx, ty, self.in_new_function) {
|
||||||
cx.lint(
|
cx.lint(UNROOTED_MUST_ROOT, |lint| {
|
||||||
UNROOTED_MUST_ROOT,
|
lint.primary_message(format!("Expression of type {:?} must be rooted", ty));
|
||||||
format!("Expression of type {:?} must be rooted", ty),
|
lint.span(pat.span);
|
||||||
|lint| {
|
})
|
||||||
lint.span(pat.span);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => {},
|
_ => {},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue