Skip to content

Commit

Permalink
Update to rust 1.80.0 (servo#32896)
Browse files Browse the repository at this point in the history
* 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

rust-lang/rust#124047
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Remove TypeVariableOriginKind

rust-lang/rust#123016
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Remove TypeVariableOrigin

rust-lang/rust#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 servo#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>
  • Loading branch information
2 people authored and Gae24 committed Aug 7, 2024
1 parent ce20ab9 commit 6840920
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 58 deletions.
3 changes: 3 additions & 0 deletions components/net/tests/resource_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ fn test_exit() {
);
resource_thread.send(CoreResourceMsg::Exit(sender)).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]
Expand Down
2 changes: 1 addition & 1 deletion etc/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ with import (builtins.fetchTarball {
overlays = [
(import (builtins.fetchTarball {
# 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 = {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[toolchain]
# Be sure to update etc/shell.nix when bumping this!
channel = "1.78.0"
channel = "1.80.0"

components = [
# For support/crown
Expand Down
7 changes: 1 addition & 6 deletions support/crown/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use rustc_ast::Mutability;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
use rustc_hir::{ImplItemRef, ItemKind, Node, OwnerId, PrimTy, TraitItemRef};
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use rustc_infer::infer::TyCtxtInferExt;
use rustc_lint::LateContext;
use rustc_middle::ty::fast_reject::SimplifiedType;
Expand Down Expand Up @@ -338,14 +337,10 @@ pub fn implements_trait_with_env<'tcx>(
return false;
}
let infcx = tcx.infer_ctxt().build();
let orig = TypeVariableOrigin {
kind: TypeVariableOriginKind::MiscVariable,
span: DUMMY_SP,
};
let ty_params = tcx.mk_args_from_iter(
ty_params
.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
.type_implements_trait(
Expand Down
24 changes: 9 additions & 15 deletions support/crown/src/trace_in_no_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,18 @@ fn incorrect_no_trace<'tcx, I: Into<MultiSpan> + Copy>(
{
let inner = substs.type_at(pos);
if inner.is_primitive_ty() {
cx.lint(
EMPTY_TRACE_IN_NO_TRACE,
EMPTY_TRACE_IN_NO_TRACE_MSG,
|lint| {
lint.span(span);
},
)
cx.lint(EMPTY_TRACE_IN_NO_TRACE, |lint| {
lint.primary_message(EMPTY_TRACE_IN_NO_TRACE_MSG);
lint.span(span);
})
} else if is_jstraceable(cx, inner) {
cx.lint(
TRACE_IN_NO_TRACE,
format!(
cx.lint(TRACE_IN_NO_TRACE, |lint| {
lint.primary_message(format!(
"must_not_have_traceable marked wrapper must not have \
jsmanaged inside on {pos}-th position. Consider removing the wrapper."
),
|lint| {
lint.span(span);
},
)
));
lint.span(span);
})
}
false
} else {
Expand Down
64 changes: 29 additions & 35 deletions support/crown/src/unrooted_must_root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,13 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
for field in def.fields() {
let field_type = cx.tcx.type_of(field.def_id);
if is_unrooted_ty(&self.symbols, cx, field_type.skip_binder(), false) {
cx.lint(
UNROOTED_MUST_ROOT,
"Type must be rooted, use #[crown::unrooted_must_root_lint::must_root] \
on the struct definition to propagate",
|lint| {
lint.span(field.span);
},
)
cx.lint(UNROOTED_MUST_ROOT, |lint| {
lint.primary_message(
"Type must be rooted, use #[crown::unrooted_must_root_lint::must_root] \
on the struct definition to propagate"
);
lint.span(field.span);
})
}
}
}
Expand All @@ -212,15 +211,14 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
for field in fields {
let field_type = cx.tcx.type_of(field.def_id);
if is_unrooted_ty(&self.symbols, cx, field_type.skip_binder(), false) {
cx.lint(
UNROOTED_MUST_ROOT,
"Type must be rooted, \
use #[crown::unrooted_must_root_lint::must_root] \
on the enum definition to propagate",
|lint| {
lint.span(field.ty.span);
},
)
cx.lint(UNROOTED_MUST_ROOT, |lint| {
lint.primary_message(
"Type must be rooted, \
use #[crown::unrooted_must_root_lint::must_root] \
on the enum definition to propagate",
);
lint.span(field.ty.span);
})
}
}
},
Expand Down Expand Up @@ -250,7 +248,8 @@ impl<'tcx> LateLintPass<'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.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);
})
}
Expand All @@ -259,7 +258,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
if !in_new_function &&
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());
})
}
Expand Down Expand Up @@ -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 ty = cx.typeck_results().expr_ty(subexpr);
if is_unrooted_ty(self.symbols, cx, ty, in_new_function) {
cx.lint(
UNROOTED_MUST_ROOT,
format!("Expression of type {:?} must be rooted", ty),
|lint| {
lint.span(subexpr.span);
},
)
cx.lint(UNROOTED_MUST_ROOT, |lint| {
lint.primary_message(format!("Expression of type {:?} must be rooted", ty));
lint.span(subexpr.span);
})
}
};

Expand Down Expand Up @@ -329,17 +326,14 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> {
// are implemented, the `Unannotated` case could cause false-positives.
// These should be fixable by adding an explicit `ref`.
match pat.kind {
hir::PatKind::Binding(hir::BindingAnnotation::NONE, ..) |
hir::PatKind::Binding(hir::BindingAnnotation::MUT, ..) => {
hir::PatKind::Binding(hir::BindingMode::NONE, ..) |
hir::PatKind::Binding(hir::BindingMode::MUT, ..) => {
let ty = cx.typeck_results().pat_ty(pat);
if is_unrooted_ty(self.symbols, cx, ty, self.in_new_function) {
cx.lint(
UNROOTED_MUST_ROOT,
format!("Expression of type {:?} must be rooted", ty),
|lint| {
lint.span(pat.span);
},
)
cx.lint(UNROOTED_MUST_ROOT, |lint| {
lint.primary_message(format!("Expression of type {:?} must be rooted", ty));
lint.span(pat.span);
})
}
},
_ => {},
Expand Down

0 comments on commit 6840920

Please sign in to comment.