Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
nightly-2023-10-22
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanventer committed Jul 10, 2024
1 parent 5b54506 commit a1afd1b
Show file tree
Hide file tree
Showing 25 changed files with 106 additions and 102 deletions.
66 changes: 33 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified binaries/summary_store.tar
Binary file not shown.
20 changes: 10 additions & 10 deletions checker/src/block_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
.type_visitor()
.get_rustc_place_type(place, self.bv.current_span);
match ty.kind() {
TyKind::Adt(..) | TyKind::Generator(..) => {
TyKind::Adt(..) | TyKind::Coroutine(..) => {
let discr_ty = ty.discriminant_ty(self.bv.tcx);
let discr_bits = match ty.discriminant_for_variant(self.bv.tcx, variant_index) {
Some(discr) => discr.val,
Expand Down Expand Up @@ -325,7 +325,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
unwind,
} => self.visit_assert(cond, *expected, msg, *target, *unwind),
mir::TerminatorKind::Yield { .. } => assume_unreachable!(),
mir::TerminatorKind::GeneratorDrop => assume_unreachable!(),
mir::TerminatorKind::CoroutineDrop => assume_unreachable!(),
mir::TerminatorKind::FalseEdge { .. } => assume_unreachable!(),
mir::TerminatorKind::FalseUnwind { .. } => assume_unreachable!(),
mir::TerminatorKind::InlineAsm { destination, .. } => {
Expand Down Expand Up @@ -693,7 +693,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
}
}
}
let self_ty_is_fn_ptr = if let Some(ty) = actual_argument_types.get(0) {
let self_ty_is_fn_ptr = if let Some(ty) = actual_argument_types.first() {
let self_ty = self.type_visitor().get_dereferenced_type(*ty);
matches!(self_ty.kind(), TyKind::FnPtr(..))
} else {
Expand Down Expand Up @@ -1025,7 +1025,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
}
match specialized_closure_ty.kind() {
TyKind::Closure(def_id, args)
| TyKind::Generator(def_id, args, _)
| TyKind::Coroutine(def_id, args, _)
| TyKind::FnDef(def_id, args) => {
return extract_func_ref(self.visit_function_reference(
*def_id,
Expand Down Expand Up @@ -2589,7 +2589,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
}
}
mir::AggregateKind::Closure(def_id, args)
| mir::AggregateKind::Generator(def_id, args, _) => {
| mir::AggregateKind::Coroutine(def_id, args, _) => {
let ty = self.bv.tcx.type_of(*def_id).skip_binder();
let func_const = self.visit_function_reference(*def_id, ty, Some(args));
let func_val = Rc::new(func_const.clone().into());
Expand Down Expand Up @@ -3409,7 +3409,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
// deserialize that and return an heap block that represents the closure state + func ptr
TyKind::Closure(def_id, args)
| TyKind::FnDef(def_id, args)
| TyKind::Generator(def_id, args, ..)
| TyKind::Coroutine(def_id, args, ..)
| TyKind::Alias(
rustc_middle::ty::Opaque,
rustc_middle::ty::AliasTy { def_id, args, .. },
Expand Down Expand Up @@ -3608,8 +3608,8 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
TyKind::Adt(adt_def, _) => adt_def
.discriminants(self.bv.tcx)
.find(|(_, var)| var.val == data),
TyKind::Generator(def_id, args, _) => {
let generator = args.as_generator();
TyKind::Coroutine(def_id, args, _) => {
let generator = args.as_coroutine();
generator
.discriminants(*def_id, self.bv.tcx)
.find(|(_, var)| var.val == data)
Expand Down Expand Up @@ -3907,7 +3907,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
self.bv.update_value_at(len_path, len_val);
}
TyKind::Closure(def_id, generic_args)
| TyKind::Generator(def_id, generic_args, ..) => {
| TyKind::Coroutine(def_id, generic_args, _) => {
let func_const = self.visit_function_reference(*def_id, ty, Some(generic_args));
let func_val = Rc::new(func_const.clone().into());
self.bv
Expand All @@ -3918,7 +3918,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com
rustc_middle::ty::AliasTy { def_id, .. },
) => {
if let TyKind::Closure(def_id, generic_args)
| TyKind::Generator(def_id, generic_args, _) =
| TyKind::Coroutine(def_id, generic_args, _) =
self.bv.tcx.type_of(*def_id).skip_binder().kind()
{
let func_const =
Expand Down
2 changes: 1 addition & 1 deletion checker/src/body_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ impl<'analysis, 'compilation, 'tcx> BodyVisitor<'analysis, 'compilation, 'tcx> {
);
match ty.kind() {
TyKind::Adt(def, _) if def.is_enum() => {}
TyKind::Generator(..) => {}
TyKind::Coroutine(..) => {}
_ => {
result = Some(self.get_u128_const_val(0));
}
Expand Down
2 changes: 1 addition & 1 deletion checker/src/call_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ impl CallSiteOutput {
file_map,
&line_and_file.file.name,
));
first_line = line_and_file.lines.get(0).map(|l| l.line_index + 1);
first_line = line_and_file.lines.first().map(|l| l.line_index + 1);
}
let callable = Callable {
name,
Expand Down
10 changes: 5 additions & 5 deletions checker/src/call_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1270,8 +1270,8 @@ impl<'call, 'block, 'analysis, 'compilation, 'tcx>
args.as_closure().args,
&self.type_visitor().generic_argument_map,
)),
TyKind::Generator(_, args, _) => Some(self.type_visitor().specialize_generic_args(
args.as_generator().args,
TyKind::Coroutine(_, args, _) => Some(self.type_visitor().specialize_generic_args(
args.as_coroutine().args,
&self.type_visitor().generic_argument_map,
)),
TyKind::FnDef(_, args)
Expand Down Expand Up @@ -2016,7 +2016,7 @@ impl<'call, 'block, 'analysis, 'compilation, 'tcx>
match rustc_gen_args[0].unpack() {
GenericArgKind::Type(ty) => match ty.kind() {
TyKind::Adt(def, _) if def.is_enum() => {}
TyKind::Generator(..) => {}
TyKind::Coroutine(..) => {}
_ => {
discriminant_value = Rc::new(ConstantDomain::U128(0).into());
}
Expand Down Expand Up @@ -2391,7 +2391,7 @@ impl<'call, 'block, 'analysis, 'compilation, 'tcx>
let source_rustc_type = self
.callee_generic_arguments
.expect("rustc type error")
.get(0)
.first()
.expect("rustc type error")
.expect_ty();
let target_path = self.block_visitor.visit_rh_place(&self.destination);
Expand Down Expand Up @@ -2426,7 +2426,7 @@ impl<'call, 'block, 'analysis, 'compilation, 'tcx>
let elem_type = self
.callee_generic_arguments
.expect("write_bytes<T>")
.get(0)
.first()
.expect("write_bytes<T>")
.expect_ty();
let mut elem_size = self.type_visitor().get_type_size(elem_type);
Expand Down
6 changes: 5 additions & 1 deletion checker/src/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ impl rustc_driver::Callbacks for MiraiCallbacks {
/// Called before creating the compiler instance
#[logfn(TRACE)]
fn config(&mut self, config: &mut interface::Config) {
self.file_name = config.input.source_name().prefer_remapped().to_string();
self.file_name = config
.input
.source_name()
.prefer_remapped_unconditionaly()
.to_string();
info!("Processing input file: {}", self.file_name);
if config.opts.test {
info!("in test only mode");
Expand Down
2 changes: 1 addition & 1 deletion checker/src/cargo_mirai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn call_cargo_on_each_package_target(package: &Package) {
for target in &package.targets {
let kind = target
.kind
.get(0)
.first()
.expect("bad cargo metadata: target::kind");
if lib_only && kind != "lib" {
continue;
Expand Down
Loading

0 comments on commit a1afd1b

Please sign in to comment.