diff --git a/.github/workflows/setup/action.yml b/.github/workflows/setup/action.yml index d85c8bf..5ca60d9 100644 --- a/.github/workflows/setup/action.yml +++ b/.github/workflows/setup/action.yml @@ -13,7 +13,7 @@ runs: shell: bash - name: Install Depot - run: curl https://raw.githubusercontent.com/cognitive-engineering-lab/depot/main/scripts/install.sh | sh -s e92a63edcb17cf156e399587b79192369911560e + run: cargo install --git https://github.com/cognitive-engineering-lab/depot.git depot-js && depot setup shell: bash - name: Install Test Libraries diff --git a/Cargo.lock b/Cargo.lock index 0aa2789..2bfb7a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -460,9 +460,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustc_plugin" -version = "0.9.0-nightly-2024-01-24" +version = "0.10.0-nightly-2024-05-20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0abfa69e634af1147ebcfd86ac7e7b745e2b2e9092f2e7f4852358ab99dfb19b" +checksum = "a5dce94a7ecc94714c9c0d34f2b887bc1a6d034faec96784684fdb3ed4d7e30e" dependencies = [ "cargo_metadata", "log", @@ -480,9 +480,9 @@ checksum = "b3c5a95edfa0c893236ae4778bb7c4752760e4c0d245e19b5eff33c5aa5eb9dc" [[package]] name = "rustc_utils" -version = "0.9.0-nightly-2024-01-24" +version = "0.10.0-nightly-2024-05-20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb3ed9a0c4c18c1973477a672cc6cf7b362e4b3d0ae6acdc5c455421e0d5e69d" +checksum = "8c56fee46db087b17536125afa453444ddb8eacfe51b263c7dff6ce26f3e5f93" dependencies = [ "anyhow", "cfg-if", diff --git a/README.md b/README.md index c1f5ad5..98ce593 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ If rustup fails, especially with an error like "could not rename the downloaded To solve the issue, go to the command line and run: ``` -rustup toolchain install nightly-2024-01-24 -c rust-src -c rustc-dev -c llvm-tools-preview +rustup toolchain install nightly-2024-05-20 -c rust-src -c rustc-dev -c llvm-tools-preview ``` Then go back to VSCode and click "Continue" to let Argus continue installing. diff --git a/crates/argus/Cargo.toml b/crates/argus/Cargo.toml index 5887a1f..7086896 100644 --- a/crates/argus/Cargo.toml +++ b/crates/argus/Cargo.toml @@ -14,7 +14,7 @@ testing = ["lazy_static", "ts-rs"] doctest = false [dependencies] -rustc_utils = { version = "=0.9.0-nightly-2024-01-24", features = ["serde"] } +rustc_utils = { version = "=0.10.0-nightly-2024-05-20", features = ["serde"] } log = "0.4" index_vec = { version = "0.1.3", features = ["serde"] } @@ -33,7 +33,7 @@ ts-rs = { version = "7.1.1", features = ["indexmap-impl"], optional = true } [dev-dependencies] argus-lib = { path = ".", features = ["testing"] } -rustc_utils = { version = "=0.9.0-nightly-2024-01-24", features = ["serde", "ts-rs"] } +rustc_utils = { version = "=0.10.0-nightly-2024-05-20", features = ["serde", "ts-rs"] } test-log = "0.2.11" env_logger = "0.9.3" text-diff = "0.4" diff --git a/crates/argus/src/analysis/entry.rs b/crates/argus/src/analysis/entry.rs index d67dc4d..aa1aca3 100644 --- a/crates/argus/src/analysis/entry.rs +++ b/crates/argus/src/analysis/entry.rs @@ -5,9 +5,8 @@ use anyhow::{anyhow, bail, Result}; use fluid_let::fluid_let; use rustc_hir::BodyId; use rustc_infer::{infer::InferCtxt, traits::PredicateObligation}; -use rustc_middle::ty::{Predicate, TyCtxt, TypeckResults}; +use rustc_middle::ty::{TyCtxt, TypeckResults}; use rustc_trait_selection::traits::solve::Goal; -use serde::Serialize; use crate::{ analysis::{ @@ -17,7 +16,6 @@ use crate::{ }, ext::{EvaluationResultExt, InferCtxtExt}, proof_tree::{serialize::serialize_proof_tree, SerializedTree}, - serialize::ty::PredicateDef, types::{ intermediate::{ ErrorAssemblyCtx, Forgettable, FullData, ObligationQueriesInBody, @@ -29,6 +27,7 @@ use crate::{ fluid_let! { pub static INSPECTING: bool; + pub static BODY_ID: BodyId; } macro_rules! guard_inspection { @@ -43,11 +42,6 @@ macro_rules! guard_inspection { // -------------------------------- // Rustc inspection points -#[derive(Serialize)] -struct PredWrapper<'a, 'tcx: 'a>( - #[serde(with = "PredicateDef")] &'a Predicate<'tcx>, -); - pub fn process_obligation<'tcx>( infcx: &InferCtxt<'tcx>, obl: &PredicateObligation<'tcx>, @@ -55,11 +49,12 @@ pub fn process_obligation<'tcx>( ) { guard_inspection! {} - let Some(_ldef_id) = infcx.body_id() else { - log::warn!("Skipping obligation unassociated with local body {obl:?}"); + let Some(body_id) = BODY_ID.copied() else { return; }; + log::trace!("RECV OBLIGATION {result:?} {obl:?}"); + // Use this to get rid of any resolved inference variables, // these could have been resolved while trying to solve the obligation // and we want to present it as such to the user. @@ -78,8 +73,6 @@ pub fn process_obligation<'tcx>( return; } - log::debug!("Processing obligation {obl:?}"); - let necessity = infcx.obligation_necessity(obl); let dataid = if matches!(necessity, ObligationNecessity::Yes) || (matches!(necessity, ObligationNecessity::OnError) && result.is_no()) @@ -89,7 +82,8 @@ pub fn process_obligation<'tcx>( None }; - let obligation = transform::compute_provenance(infcx, obl, result, dataid); + let obligation = + transform::compute_provenance(body_id, infcx, obl, result, dataid); tls::store_obligation(obligation); @@ -195,11 +189,13 @@ fn generate_tree<'tcx>( predicate: obligation.predicate, param_env: obligation.param_env, }; - let item_def_id = infcx - .body_id() - .ok_or(anyhow!("body not local"))? - .to_def_id(); - serialize_proof_tree(goal, infcx, item_def_id) + + let Some(body_id) = BODY_ID.copied() else { + bail!("missing body id"); + }; + + let body_owner = infcx.tcx.hir().body_owner_def_id(body_id).to_def_id(); + serialize_proof_tree(goal, obligation.cause.span, infcx, body_owner) } pub(in crate::analysis) fn build_obligations_in_body<'tcx>( diff --git a/crates/argus/src/analysis/hir.rs b/crates/argus/src/analysis/hir.rs index 024c1ae..7463c56 100644 --- a/crates/argus/src/analysis/hir.rs +++ b/crates/argus/src/analysis/hir.rs @@ -94,6 +94,12 @@ impl BinCreator<'_, '_> { .collect::>(); if !obligations.is_empty() { + log::debug!( + "Associating obligations with {kind:?} {:?}\n{:#?}", + self.ctx.tcx.hir().node_to_string(target), + obligations + ); + self.bins.push(Bin { hir_id: target, obligations, @@ -104,23 +110,29 @@ impl BinCreator<'_, '_> { } impl<'a, 'tcx: 'a> HirVisitor<'_> for BinCreator<'a, 'tcx> { + // FIXME: after updating to nightly-2024-05-20 this binning logic broke slightly. + // Obligations associated with parameters are now being assigned to the overall call, + // this makes more things use a method call table than necessary. fn visit_expr(&mut self, ex: &hir::Expr) { + // Drain nested obligations first to match the most specific node possible. hir::intravisit::walk_expr(self, ex); match ex.kind { hir::ExprKind::Call(callable, args) => { - self.drain_nested(callable.hir_id, BinKind::CallableExpr); for arg in args { self.drain_nested(arg.hir_id, BinKind::CallArg); } + self.drain_nested(callable.hir_id, BinKind::CallableExpr); self.drain_nested(ex.hir_id, BinKind::Call); } hir::ExprKind::MethodCall(_, func, args, _) => { - self.drain_nested(func.hir_id, BinKind::MethodReceiver); for arg in args { self.drain_nested(arg.hir_id, BinKind::CallArg); } - self.drain_nested(ex.hir_id, BinKind::MethodCall); + self.drain_nested(func.hir_id, BinKind::MethodReceiver); + // [ ] TODO (see above `FIXME`): + // self.drain_nested(ex.hir_id, BinKind::MethodCall); + self.drain_nested(ex.hir_id, BinKind::Misc); } _ => {} } @@ -193,14 +205,13 @@ macro_rules! simple_visitors { impl HirVisitor<'_> for FindNodeBySpan { simple_visitors! { [visit_param, walk_param, hir::Param], - [visit_local, walk_local, hir::Local], + [visit_local, walk_local, hir::LetStmt], [visit_block, walk_block, hir::Block], [visit_stmt, walk_stmt, hir::Stmt], [visit_arm, walk_arm, hir::Arm], [visit_pat, walk_pat, hir::Pat], [visit_pat_field, walk_pat_field, hir::PatField], [visit_expr, walk_expr, hir::Expr], - [visit_let_expr, walk_let_expr, hir::Let], [visit_expr_field, walk_expr_field, hir::ExprField], [visit_ty, walk_ty, hir::Ty], [visit_generic_param, walk_generic_param, hir::GenericParam], diff --git a/crates/argus/src/analysis/mod.rs b/crates/argus/src/analysis/mod.rs index 2d3f60c..d7ad419 100644 --- a/crates/argus/src/analysis/mod.rs +++ b/crates/argus/src/analysis/mod.rs @@ -34,7 +34,7 @@ pub fn obligations<'tcx>( body_id: BodyId, ) -> Result { rustc_middle::ty::print::with_no_trimmed_paths! {{ - log::info!("Typeck'ing body {body_id:?}"); + fluid_let::fluid_set!(entry::BODY_ID, body_id); let typeck_results = tcx.inspect_typeck(body_id, entry::process_obligation); @@ -50,6 +50,8 @@ pub fn tree<'tcx>( body_id: BodyId, ) -> Result { rustc_middle::ty::print::with_no_trimmed_paths! {{ + fluid_let::fluid_set!(entry::BODY_ID, body_id); + let typeck_results = tcx.inspect_typeck(body_id, entry::process_obligation_for_tree); @@ -62,6 +64,8 @@ pub fn tree<'tcx>( /// NOTE: this requires quite a bit of memory as everything is generated eagerly, favor /// using a combination of `obligation` and `tree` analyses for a reduced memory footprint. pub fn bundle<'tcx>(tcx: TyCtxt<'tcx>, body_id: BodyId) -> Result { + fluid_let::fluid_set!(entry::BODY_ID, body_id); + let (full_data, obligations_in_body) = body_data(tcx, body_id)?; let t = (&*full_data, &obligations_in_body); let thunk = || t; @@ -82,6 +86,7 @@ pub fn bundle<'tcx>(tcx: TyCtxt<'tcx>, body_id: BodyId) -> Result { .prefer_local() .to_string_lossy() .to_string(); + Ok(BodyBundle { filename, body: obligations_in_body, diff --git a/crates/argus/src/analysis/tls.rs b/crates/argus/src/analysis/tls.rs index 2fb67b0..111ab9e 100644 --- a/crates/argus/src/analysis/tls.rs +++ b/crates/argus/src/analysis/tls.rs @@ -119,7 +119,7 @@ pub fn replace_reported_errors(infcx: &InferCtxt) { .reported_trait_errors .borrow() .iter() - .map(|(span, predicates)| { + .map(|(span, (predicates, _))| { ( *span, predicates diff --git a/crates/argus/src/analysis/transform.rs b/crates/argus/src/analysis/transform.rs index 1110899..4a0de95 100644 --- a/crates/argus/src/analysis/transform.rs +++ b/crates/argus/src/analysis/transform.rs @@ -5,11 +5,9 @@ use rustc_data_structures::fx::{FxHashMap as HashMap, FxIndexMap}; use rustc_hir::{self as hir, intravisit::Map, BodyId, HirId}; use rustc_infer::{ infer::{canonical::OriginalQueryValues, InferCtxt, InferOk}, - traits::{self, ObligationCauseCode, PredicateObligation}, -}; -use rustc_middle::ty::{ - self, ParamEnvAnd, ToPredicate, Ty, TyCtxt, TypeckResults, + traits::{self, PredicateObligation}, }; +use rustc_middle::ty::{self, ParamEnvAnd, Ty, TyCtxt, TypeckResults, Upcast}; use rustc_span::Span; use rustc_utils::source_map::range::CharRange; @@ -19,10 +17,7 @@ use super::{ EvaluationResult, }; use crate::{ - ext::{ - EvaluationResultExt, InferCtxtExt, PredicateExt, TyCtxtExt, - TypeckResultsExt, - }, + ext::{InferCtxtExt, PredicateExt, TyCtxtExt, TypeckResultsExt}, types::{intermediate::*, *}, }; @@ -40,21 +35,17 @@ macro_rules! property_is_ok { } pub fn compute_provenance<'tcx>( + body_id: BodyId, infcx: &InferCtxt<'tcx>, obligation: &PredicateObligation<'tcx>, result: EvaluationResult, dataid: Option, ) -> Provenance { - let Some(ldef_id) = infcx.body_id() else { - unreachable!("argus analysis should only happen on local bodies"); - }; - let hir = infcx.tcx.hir(); let fdata = infcx.bless_fulfilled(obligation, result, false); // If the span is coming from a macro, point to the callsite. let callsite_cause_span = fdata.obligation.cause.span.source_callsite(); - let body_id = hir.body_owned_by(ldef_id); let hir_id = hier_hir::find_most_enclosing_node( &infcx.tcx, body_id, @@ -220,16 +211,15 @@ impl<'a, 'tcx: 'a> ObligationsBuilder<'a, 'tcx> { BinKind::Call => Call, BinKind::MethodReceiver => MethodReceiver, BinKind::MethodCall => { - let Some(hir::Node::Expr( + let hir::Node::Expr( call_expr @ hir::Expr { kind: hir::ExprKind::MethodCall(segment, recvr, args, call_span), .. }, - )) = hir.find(hir_id) + ) = hir.hir_node(hir_id) else { unreachable!( - "Bin kind `MethodCall` for non `ExprKind::MethodCall` {:?}", - hir.node_to_string(hir_id) + "bin kind is method call, but node is not method call" ); }; @@ -446,16 +436,8 @@ impl<'a, 'tcx: 'a> ObligationsBuilder<'a, 'tcx> { ); } - let is_necessary = // Bounds for extension method calls are always trait predicates. - fdata.obligation.predicate.is_trait_predicate() && - // FIXME: Obligations for method calls are registered under 'misc,' - // this of course could change. There should be a stronger way - // to gather the attempted traits. - matches!( - fdata.obligation.cause.code(), - ObligationCauseCode::MiscObligation - ); + let is_necessary = fdata.obligation.predicate.is_trait_predicate(); is_necessary.then(|| { (idx, expect_trait_ref(&fdata.obligation.predicate).def_id()) @@ -517,19 +499,11 @@ impl<'a, 'tcx: 'a> ObligationsBuilder<'a, 'tcx> { let ty_id = |ty: Ty<'tcx>| ty; - let ty_with_ref = move |ty: Ty<'tcx>| { - Ty::new_ref(tcx, region, ty::TypeAndMut { - ty, - mutbl: hir::Mutability::Not, - }) - }; + let ty_with_ref = + move |ty: Ty<'tcx>| Ty::new_ref(tcx, region, ty, hir::Mutability::Not); - let ty_with_mut_ref = move |ty: Ty<'tcx>| { - Ty::new_ref(tcx, region, ty::TypeAndMut { - ty, - mutbl: hir::Mutability::Mut, - }) - }; + let ty_with_mut_ref = + move |ty: Ty<'tcx>| Ty::new_ref(tcx, region, ty, hir::Mutability::Mut); // TODO: rustc also considers raw pointers, ignoring for now ... let ty_mutators: Vec<&dyn Fn(Ty<'tcx>) -> Ty<'tcx>> = @@ -568,8 +542,7 @@ impl<'a, 'tcx: 'a> ObligationsBuilder<'a, 'tcx> { for trait_ref in trait_candidates.iter() { let trait_ref = trait_ref.with_self_ty(tcx, self_ty); - let predicate: ty::Predicate<'tcx> = - ty::Binder::dummy(trait_ref).to_predicate(self.tcx); + let predicate: ty::Predicate<'tcx> = trait_ref.upcast(self.tcx); let obligation = traits::Obligation::new( tcx, o.cause.clone(), @@ -580,8 +553,13 @@ impl<'a, 'tcx: 'a> ObligationsBuilder<'a, 'tcx> { infcx.probe(|_| { let res = infcx.evaluate_obligation(&obligation); - let mut with_provenance = - compute_provenance(&infcx, &obligation, res, None); + let mut with_provenance = compute_provenance( + self.body_id, + &infcx, + &obligation, + res, + None, + ); let syn_id = self.synthetic_data.add(SyntheticData { full_data: full_query_idx, @@ -670,7 +648,7 @@ impl<'a, 'tcx: 'a> ObligationsBuilder<'a, 'tcx> { anyhow::ensure!(exists, "synthetic data not found for {:?}", obl) } else if matches!(obl.necessity, ObligationNecessity::Yes) || (matches!(obl.necessity, ObligationNecessity::OnError) - && obl.result.is_no()) + && obl.result.is_err()) { let exists = self.full_data.iter().any(|fdata| fdata.hash == obl.hash); @@ -743,12 +721,13 @@ mod tree_search { } impl<'tcx> ProofTreeVisitor<'tcx> for BranchlessSearch { - type BreakTy = (); + type Result = ControlFlow<()>; - fn visit_goal( - &mut self, - goal: &InspectGoal<'_, 'tcx>, - ) -> ControlFlow { + fn span(&self) -> Span { + rustc_span::DUMMY_SP + } + + fn visit_goal(&mut self, goal: &InspectGoal<'_, 'tcx>) -> Self::Result { let infcx = goal.infcx(); let predicate = &goal.goal().predicate; let hash = infcx.predicate_hash(predicate).into(); @@ -759,9 +738,9 @@ mod tree_search { let candidates = goal.candidates(); if 1 == candidates.len() { - ControlFlow::Break(()) + candidates[0].visit_nested_in_probe(self) } else { - candidates[0].visit_nested(self) + ControlFlow::Break(()) } } } diff --git a/crates/argus/src/ext.rs b/crates/argus/src/ext.rs index 8cec016..ac27d6e 100644 --- a/crates/argus/src/ext.rs +++ b/crates/argus/src/ext.rs @@ -2,18 +2,14 @@ use rustc_data_structures::{ fx::FxIndexMap, stable_hasher::{Hash64, HashStable, StableHasher}, }; -use rustc_hir::{ - def_id::{DefId, LocalDefId}, - BodyId, HirId, -}; +use rustc_hir::{def_id::DefId, BodyId, HirId}; use rustc_hir_typeck::inspect_typeck; use rustc_infer::{ infer::InferCtxt, traits::{ObligationInspector, PredicateObligation}, }; use rustc_middle::ty::{ - self, Predicate, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, - TypeckResults, + self, Predicate, Ty, TyCtxt, TypeFoldable, TypeckResults, }; use rustc_query_system::ich::StableHashingContext; use rustc_span::FileName; @@ -23,7 +19,6 @@ use serde::Serialize; use crate::{ analysis::{EvaluationResult, FulfillmentData}, - rustc, serialize::{ safe::TraitRefPrintOnlyTraitPathDef, serialize_to_value, ty::PredicateObligationDef, @@ -201,8 +196,6 @@ pub trait InferCtxtExt<'tcx> { obligation: &PredicateObligation<'tcx>, ) -> ObligationNecessity; - fn body_id(&self) -> Option; - fn predicate_hash(&self, p: &Predicate<'tcx>) -> Hash64; fn evaluate_obligation( @@ -270,7 +263,7 @@ pub fn group_predicates_by_ty<'tcx>( let trait_ref = poly_trait_pred.map_bound(|tr| tr.trait_ref).skip_binder(); let bound = ClauseBound::Trait( - poly_trait_pred.polarity(), + poly_trait_pred.polarity().into(), TraitRefPrintOnlyTraitPathDef(trait_ref), ); grouped.entry(ty).or_default().push(bound); @@ -314,13 +307,6 @@ impl<'tcx> TyCtxtExt<'tcx> for TyCtxt<'tcx> { let tcx = *self; let impl_def_id = def_id; - // From [`rustc_trait_selection::traits::specialize`] - log::debug!( - "Serializing this impl header\n{}", - rustc::to_pretty_impl_header(tcx, impl_def_id) - .unwrap_or(String::from("{failed to get header}")) - ); - let trait_ref = tcx.impl_trait_ref(impl_def_id)?.instantiate_identity(); let args = ty::GenericArgs::identity_for_item(tcx, impl_def_id); @@ -347,7 +333,10 @@ impl<'tcx> TyCtxtExt<'tcx> for TyCtxt<'tcx> { if let Some(poly_trait_ref) = p.as_trait_clause() { if Some(poly_trait_ref.def_id()) == sized_trait { types_without_default_bounds - .remove(&poly_trait_ref.self_ty().skip_binder()); + // NOTE: we don't rely on the ordering of the types without bounds here, + // so `swap_remove` is preferred because it's O(1) instead of `shift_remove` + // which is O(n). + .swap_remove(&poly_trait_ref.self_ty().skip_binder()); continue; } } @@ -448,16 +437,14 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { &self, obligation: &PredicateObligation<'tcx>, ) -> ObligationNecessity { - use rustc_infer::traits::ObligationCauseCode::*; - use ObligationNecessity::*; + use rustc_infer::traits::ObligationCauseCode; + use ObligationNecessity as ON; let p = &obligation.predicate; let code = obligation.cause.code(); - if matches!(code, SizedReturnType) && p.is_lhs_unit() { - No - } else if matches!(code, MiscObligation) { - No + if matches!(code, ObligationCauseCode::SizedReturnType) && p.is_lhs_unit() { + ON::No } else { self.guess_predicate_necessity(p) } @@ -484,16 +471,6 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { } } - // TODO there has to be a better way to do this, right? - fn body_id(&self) -> Option { - use rustc_infer::traits::DefiningAnchor::*; - if let Bind(ldef_id) = self.defining_use_anchor { - Some(ldef_id) - } else { - None - } - } - fn predicate_hash(&self, p: &Predicate<'tcx>) -> Hash64 { let mut freshener = rustc_infer::infer::TypeFreshener::new(self); let p = p.fold_with(&mut freshener); @@ -556,66 +533,8 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { .evaluate_root_goal(obligation.clone().into(), GenerateProofTree::Never) .0 { - Ok((_, c, _)) => Ok(c), + Ok((_, c)) => Ok(c), _ => Err(NoSolution), } } } - -mod ty_eraser { - use super::*; - - pub(super) struct TyVarEraserVisitor<'a, 'tcx: 'a> { - pub infcx: &'a InferCtxt<'tcx>, - } - - // FIXME: these placeholders are a huge hack, there's definitely - // something better we could do here. - macro_rules! gen_placeholders { - ($( [$f:ident $n:literal],)*) => {$( - fn $f(&self) -> Ty<'tcx> { - Ty::new_placeholder(self.infcx.tcx, ty::PlaceholderType { - universe: self.infcx.universe(), - bound: ty::BoundTy { - var: ty::BoundVar::from_u32(ty::BoundVar::MAX_AS_U32 - $n), - kind: ty::BoundTyKind::Anon, - }, - }) - })* - } - } - - impl<'a, 'tcx: 'a> TyVarEraserVisitor<'a, 'tcx> { - gen_placeholders! { - [ty_placeholder 0], - [int_placeholder 1], - [float_placeholder 2], - } - } - - impl<'tcx> TypeFolder> for TyVarEraserVisitor<'_, 'tcx> { - fn interner(&self) -> TyCtxt<'tcx> { - self.infcx.tcx - } - - fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> { - // HACK: I'm not sure if replacing type variables with - // an anonymous placeholder is the best idea. It is *an* - // idea, certainly. But this should only happen before hashing. - match ty.kind() { - ty::Infer(ty::TyVar(_)) => self.ty_placeholder(), - ty::Infer(ty::IntVar(_)) => self.int_placeholder(), - ty::Infer(ty::FloatVar(_)) => self.float_placeholder(), - _ => ty.super_fold_with(self), - } - } - - fn fold_binder(&mut self, t: ty::Binder<'tcx, T>) -> ty::Binder<'tcx, T> - where - T: TypeFoldable>, - { - let u = self.infcx.tcx.anonymize_bound_vars(t); - u.super_fold_with(self) - } - } -} diff --git a/crates/argus/src/lib.rs b/crates/argus/src/lib.rs index 2d40ca0..a385329 100644 --- a/crates/argus/src/lib.rs +++ b/crates/argus/src/lib.rs @@ -26,6 +26,7 @@ extern crate rustc_infer; extern crate rustc_interface; extern crate rustc_macros; extern crate rustc_middle; +extern crate rustc_next_trait_solver; extern crate rustc_query_system; extern crate rustc_serialize; extern crate rustc_session; diff --git a/crates/argus/src/proof_tree/ext.rs b/crates/argus/src/proof_tree/ext.rs deleted file mode 100644 index 1769212..0000000 --- a/crates/argus/src/proof_tree/ext.rs +++ /dev/null @@ -1,74 +0,0 @@ -use rustc_hir::def_id::DefId; -use rustc_infer::infer::InferCtxt; -use rustc_trait_selection::{ - solve::inspect::InspectCandidate, - traits::{ - query::NoSolution, - solve::{inspect::ProbeKind, CandidateSource, Certainty, MaybeCause}, - }, -}; - -use crate::types::intermediate::EvaluationResult; - -/// Pretty printing for results. -pub trait EvaluationResultExt { - fn pretty(&self) -> String; - fn is_yes(&self) -> bool; -} - -/// Pretty printing for `Candidates`. -pub trait CandidateExt { - fn pretty(&self, infcx: &InferCtxt, def_id: DefId) -> String; - - fn is_informative_probe(&self) -> bool; -} - -/// Pretty printer for results -impl EvaluationResultExt for EvaluationResult { - fn is_yes(&self) -> bool { - matches!(self, Ok(Certainty::Yes)) - } - - fn pretty(&self) -> String { - let str = match self { - Ok(Certainty::Yes) => "Yes", - Ok(Certainty::Maybe(MaybeCause::Overflow)) => "No: Overflow", - Ok(Certainty::Maybe(MaybeCause::Ambiguity)) => "No: Ambiguity", - Err(NoSolution) => "No", - }; - - str.to_string() - } -} - -impl CandidateExt for InspectCandidate<'_, '_> { - fn pretty(&self, _infcx: &InferCtxt, _def_id: DefId) -> String { - match self.kind() { - ProbeKind::Root { .. } => "root".to_string(), - ProbeKind::NormalizedSelfTyAssembly => { - "normalized-self-ty-asm".to_string() - } - ProbeKind::UnsizeAssembly => "unsize-asm".to_string(), - ProbeKind::CommitIfOk => "commit-if-ok".to_string(), - ProbeKind::UpcastProjectionCompatibility => { - "upcase-proj-compat".to_string() - } - ProbeKind::MiscCandidate { name, .. } => format!("misc-{}", name), - ProbeKind::TraitCandidate { source, .. } => match source { - CandidateSource::BuiltinImpl(_built_impl) => "builtin".to_string(), - CandidateSource::AliasBound => "alias-bound".to_string(), - - // The only two we really care about. - CandidateSource::ParamEnv(idx) => format!("param-env#{idx}"), - CandidateSource::Impl(_def_id) => "impl".to_string(), - }, - } - } - - fn is_informative_probe(&self) -> bool { - matches!(self.kind(), ProbeKind::TraitCandidate { - source: CandidateSource::Impl(_) | CandidateSource::ParamEnv(_), - .. - }) - } -} diff --git a/crates/argus/src/proof_tree/format.rs b/crates/argus/src/proof_tree/format.rs new file mode 100644 index 0000000..82928f3 --- /dev/null +++ b/crates/argus/src/proof_tree/format.rs @@ -0,0 +1,132 @@ +use std::fmt::Write; + +use rustc_infer::infer::InferCtxt; +use rustc_middle::ty::Predicate; +use rustc_span::Span; +use rustc_trait_selection::{ + solve::inspect::{ + InspectCandidate, InspectGoal, ProofTreeInferCtxtExt, ProofTreeVisitor, + }, + traits::solve, +}; + +pub fn dump_proof_tree<'tcx>( + goal: solve::Goal<'tcx, Predicate<'tcx>>, + span: Span, + infcx: &InferCtxt<'tcx>, +) { + let do_format = move |f: &mut std::fmt::Formatter<'_>| { + let mut fm = ProofTreeFormatter::new(f, span); + infcx.visit_proof_tree(goal, &mut fm); + Ok(()) + }; + + log::debug!("TREE DUMP\nFor {:?}\n{:?}", goal, Formatter(&do_format)); +} + +struct Formatter<'a>( + &'a dyn Fn(&mut std::fmt::Formatter<'_>) -> std::fmt::Result, +); + +impl std::fmt::Debug for Formatter<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + (self.0)(f) + } +} + +pub struct ProofTreeFormatter<'a, 'b> { + f: &'a mut (dyn Write + 'b), + span: Span, +} + +enum IndentorState { + StartWithNewline, + OnNewline, + Inline, +} + +/// A formatter which adds 4 spaces of indentation to its input before +/// passing it on to its nested formatter. +/// +/// We can use this for arbitrary levels of indentation by nesting it. +struct Indentor<'a, 'b> { + f: &'a mut (dyn Write + 'b), + state: IndentorState, +} + +impl Write for Indentor<'_, '_> { + fn write_str(&mut self, s: &str) -> std::fmt::Result { + for line in s.split_inclusive('\n') { + match self.state { + IndentorState::StartWithNewline => self.f.write_str("\n ")?, + IndentorState::OnNewline => self.f.write_str(" ")?, + IndentorState::Inline => {} + } + self.state = if line.ends_with('\n') { + IndentorState::OnNewline + } else { + IndentorState::Inline + }; + self.f.write_str(line)?; + } + + Ok(()) + } +} + +impl<'a, 'b, 'tcx> ProofTreeFormatter<'a, 'b> { + pub(super) fn new(f: &'a mut (dyn Write + 'b), span: Span) -> Self { + ProofTreeFormatter { f, span } + } + + fn nested(&mut self, func: F) -> std::fmt::Result + where + F: FnOnce(&mut ProofTreeFormatter<'_, '_>) -> std::fmt::Result, + { + write!(self.f, " {{")?; + func(&mut ProofTreeFormatter { + f: &mut Indentor { + f: self.f, + state: IndentorState::StartWithNewline, + }, + span: self.span, + })?; + writeln!(self.f, "}}") + } + + fn format_goal(&mut self, goal: &InspectGoal<'_, '_>) -> std::fmt::Result { + write!(self.f, "GOAL: {:?}", goal.goal())?; + let candidates = goal.candidates(); + write!(self.f, "\n({} candidates)", candidates.len())?; + self.nested(move |this| { + for (i, can) in candidates.into_iter().enumerate() { + write!(this.f, "CANDIDATE {i}: ")?; + this.format_candidate(can)?; + } + Ok(()) + }) + } + + fn format_candidate( + &mut self, + candidate: InspectCandidate<'_, 'tcx>, + ) -> std::fmt::Result { + write!(self.f, "{:?}", candidate.kind())?; + self.nested(|this| { + candidate.visit_nested_in_probe(this); + Ok(()) + }) + } +} + +impl<'a, 'b, 'tcx> ProofTreeVisitor<'tcx> for ProofTreeFormatter<'a, 'b> { + type Result = (); + + fn span(&self) -> Span { + self.span + } + + fn visit_goal(&mut self, goal: &InspectGoal<'_, 'tcx>) -> Self::Result { + self.format_goal(goal).unwrap() + } +} diff --git a/crates/argus/src/proof_tree/interners.rs b/crates/argus/src/proof_tree/interners.rs index ba8f671..effeeba 100644 --- a/crates/argus/src/proof_tree/interners.rs +++ b/crates/argus/src/proof_tree/interners.rs @@ -116,13 +116,17 @@ impl Interners { ProbeKind::NormalizedSelfTyAssembly => { self.intern_can_string("normalized-self-ty-asm") } + ProbeKind::TryNormalizeNonRigid { .. } => { + self.intern_can_string("try-normalize-non-rigid") + } ProbeKind::UnsizeAssembly => self.intern_can_string("unsize-asm"), - ProbeKind::CommitIfOk => self.intern_can_string("commit-if-ok"), ProbeKind::UpcastProjectionCompatibility => { self.intern_can_string("upcase-proj-compat") } - ProbeKind::MiscCandidate { .. } => self.intern_can_string("misc"), ProbeKind::TraitCandidate { source, .. } => match source { + CandidateSource::CoherenceUnknowable => { + self.intern_can_string("coherence-unknowable") + } CandidateSource::BuiltinImpl(_built_impl) => { self.intern_can_string("builtin") } @@ -131,9 +135,15 @@ impl Interners { CandidateSource::ParamEnv(idx) => self.intern_can_param_env(idx), CandidateSource::Impl(def_id) => { - self.intern_impl(candidate.infcx(), def_id) + self.intern_impl(candidate.goal().infcx(), def_id) } }, + ProbeKind::ShadowedEnvProbing => { + self.intern_can_string("shadowed-env-probing") + } + ProbeKind::OpaqueTypeStorageLookup { .. } => { + self.intern_can_string("opaque-type-storage-lookup") + } }; Node::Candidate(can_idx) diff --git a/crates/argus/src/proof_tree/mod.rs b/crates/argus/src/proof_tree/mod.rs index c92c34c..6e52bd9 100644 --- a/crates/argus/src/proof_tree/mod.rs +++ b/crates/argus/src/proof_tree/mod.rs @@ -1,6 +1,6 @@ //! Proof tree types sent to the Argus frontend. -pub mod ext; +pub(self) mod format; pub(self) mod interners; pub(super) mod serialize; pub mod topology; diff --git a/crates/argus/src/proof_tree/serialize.rs b/crates/argus/src/proof_tree/serialize.rs index e6a7187..3f26ec9 100644 --- a/crates/argus/src/proof_tree/serialize.rs +++ b/crates/argus/src/proof_tree/serialize.rs @@ -1,11 +1,11 @@ -use std::{collections::HashSet, ops::ControlFlow}; +use std::collections::HashSet; use anyhow::{bail, Result}; -use ext::CandidateExt; use index_vec::IndexVec; use rustc_hir::def_id::DefId; use rustc_infer::infer::InferCtxt; use rustc_middle::ty::Predicate; +use rustc_span::Span; use rustc_trait_selection::{ solve::inspect::{InspectGoal, ProofTreeInferCtxtExt, ProofTreeVisitor}, traits::solve, @@ -14,7 +14,6 @@ use rustc_trait_selection::{ use super::{interners::Interners, *}; pub struct SerializedTreeVisitor { - pub def_id: DefId, pub root: Option, pub previous: Option, pub nodes: IndexVec, @@ -25,9 +24,8 @@ pub struct SerializedTreeVisitor { } impl SerializedTreeVisitor { - pub fn new(def_id: DefId) -> Self { + pub fn new() -> Self { SerializedTreeVisitor { - def_id, root: None, previous: None, nodes: IndexVec::default(), @@ -119,12 +117,13 @@ impl SerializedTreeVisitor { } impl<'tcx> ProofTreeVisitor<'tcx> for SerializedTreeVisitor { - type BreakTy = !; + type Result = (); - fn visit_goal( - &mut self, - goal: &InspectGoal<'_, 'tcx>, - ) -> ControlFlow { + fn span(&self) -> Span { + rustc_span::DUMMY_SP + } + + fn visit_goal(&mut self, goal: &InspectGoal<'_, 'tcx>) -> Self::Result { let here_node = self.interners.mk_goal_node(goal); let here_idx = self.nodes.push(here_node.clone()); @@ -153,32 +152,29 @@ impl<'tcx> ProofTreeVisitor<'tcx> for SerializedTreeVisitor { }; for c in goal.candidates() { - if !c.is_informative_probe() { - continue; - } - let here_candidate = self.interners.mk_candidate_node(&c); let candidate_idx = self.nodes.push(here_candidate); self.topology.add(here_idx, candidate_idx); self.previous = Some(candidate_idx); - c.visit_nested(self)?; + c.visit_nested_in_probe(self); add_result_if_empty(self, candidate_idx); } add_result_if_empty(self, here_idx); self.previous = here_parent; - - ControlFlow::Continue(()) } } pub fn serialize_proof_tree<'tcx>( goal: solve::Goal<'tcx, Predicate<'tcx>>, + span: Span, infcx: &InferCtxt<'tcx>, - def_id: DefId, + _def_id: DefId, ) -> Result { + super::format::dump_proof_tree(goal, span, infcx); + infcx.probe(|_| { - let mut visitor = SerializedTreeVisitor::new(def_id); + let mut visitor = SerializedTreeVisitor::new(); infcx.visit_proof_tree(goal, &mut visitor); visitor.into_tree() }) diff --git a/crates/argus/src/rustc/fn_ctx.rs b/crates/argus/src/rustc/fn_ctx.rs index bd862c7..a1ea5c4 100644 --- a/crates/argus/src/rustc/fn_ctx.rs +++ b/crates/argus/src/rustc/fn_ctx.rs @@ -1,5 +1,7 @@ //! We don't have access to a `FnCtxt`, but many of these methods //! *don't require* the function context, just the `TyCtxt` or `InferCtxt`. +//! +//! See [https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs] use std::ops::ControlFlow; @@ -8,10 +10,7 @@ use rustc_hir::{ def::{DefKind, Res}, def_id::DefId, }; -use rustc_infer::{ - infer::{type_variable::TypeVariableOriginKind, InferCtxt}, - traits::ObligationCauseCode, -}; +use rustc_infer::{infer::InferCtxt, traits::ObligationCauseCode}; use rustc_middle::ty::{ self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor, }; @@ -109,7 +108,7 @@ pub trait FnCtxtExt<'tcx> { fn blame_specific_expr_if_possible_for_derived_predicate_obligation( &self, - obligation: &traits::ImplDerivedObligationCause<'tcx>, + obligation: &traits::ImplDerivedCause<'tcx>, expr: &'tcx hir::Expr<'tcx>, ) -> Result<&'tcx hir::Expr<'tcx>, &'tcx hir::Expr<'tcx>>; @@ -126,14 +125,13 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { &self, error: &mut traits::FulfillmentError<'tcx>, ) -> bool { - let (traits::ExprItemObligation(def_id, hir_id, idx) - | traits::ExprBindingObligation(def_id, _, hir_id, idx)) = + let ObligationCauseCode::WhereClauseInExpr(def_id, _, hir_id, idx) = *error.obligation.cause.code().peel_derives() else { return false; }; - let Some(unsubstituted_pred) = self + let Some(uninstantiated_pred) = self .tcx .predicates_of(def_id) .instantiate_identity(self.tcx) @@ -146,12 +144,12 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { let generics = self.tcx.generics_of(def_id); let (predicate_args, predicate_self_type_to_point_at) = - match unsubstituted_pred.kind().skip_binder() { + match uninstantiated_pred.kind().skip_binder() { ty::ClauseKind::Trait(pred) => { (pred.trait_ref.args.to_vec(), Some(pred.self_ty().into())) } ty::ClauseKind::Projection(pred) => { - (pred.projection_ty.args.to_vec(), None) + (pred.projection_term.args.to_vec(), None) } ty::ClauseKind::ConstArgHasType(arg, ty) => { (vec![ty.into(), arg.into()], None) @@ -215,7 +213,6 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { .find_ambiguous_parameter_in(def_id, error.root_obligation.predicate); } - let hir = self.tcx.hir(); let (expr, qpath) = match self.tcx.hir_node(hir_id) { hir::Node::Expr(expr) => { if self.closure_span_overlaps_error(error, expr.span) { @@ -250,7 +247,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { hir_id: call_hir_id, span: call_span, .. - }) = hir.get_parent(hir_id) + }) = self.tcx.parent_hir_node(hir_id) && callee.hir_id == hir_id { if self.closure_span_overlaps_error(error, *call_span) { @@ -304,7 +301,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { // the method's turbofish segments but still use `FunctionArgumentObligation` // elsewhere. Hopefully this doesn't break something. error.obligation.cause.map_code(|parent_code| { - ObligationCauseCode::FunctionArgumentObligation { + ObligationCauseCode::FunctionArg { arg_hir_id: receiver.hir_id, call_hir_id: hir_id, parent_code, @@ -355,10 +352,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { } Some(hir::ExprKind::Struct(qpath, fields, ..)) => { if let Res::Def(DefKind::Struct | DefKind::Variant, variant_def_id) = - self - .typeck_results - // .borrow() - .qpath_res(qpath, hir_id) + self.typeck_results.qpath_res(qpath, hir_id) { for param in [ param_to_point_at, @@ -498,22 +492,18 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { DefId, ); impl<'tcx> TypeVisitor> for FindAmbiguousParameter<'_, 'tcx> { - type BreakTy = ty::GenericArg<'tcx>; - fn visit_ty( - &mut self, - ty: Ty<'tcx>, - ) -> std::ops::ControlFlow { + type Result = ControlFlow>; + fn visit_ty(&mut self, ty: Ty<'tcx>) -> Self::Result { if let Some(origin) = self.0.type_var_origin(ty) - && let TypeVariableOriginKind::TypeParameterDefinition(_, def_id) = - origin.kind + && let Some(def_id) = origin.param_def_id && let generics = self.0.tcx.generics_of(self.1) && let Some(index) = generics.param_def_id_to_index(self.0.tcx, def_id) - && let Some(subst) = + && let Some(arg) = ty::GenericArgs::identity_for_item(self.0.tcx, self.1) .get(index as usize) { - ControlFlow::Break(*subst) + ControlFlow::Break(*arg) } else { ty.super_visit_with(self) } @@ -528,7 +518,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { error: &traits::FulfillmentError<'tcx>, span: Span, ) -> bool { - if let traits::FulfillmentErrorCode::SelectionError( + if let traits::FulfillmentErrorCode::Select( traits::SelectionError::SignatureMismatch( box traits::SignatureMismatchData { expected_trait_ref, .. @@ -536,7 +526,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { ), ) = error.code && let ty::Closure(def_id, _) | ty::Coroutine(def_id, ..) = - expected_trait_ref.skip_binder().self_ty().kind() + expected_trait_ref.self_ty().kind() && span.overlaps(self.tcx.def_span(*def_id)) { true @@ -634,7 +624,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { } error.obligation.cause.map_code(|parent_code| { - ObligationCauseCode::FunctionArgumentObligation { + ObligationCauseCode::FunctionArg { arg_hir_id: arg.hir_id, call_hir_id, parent_code, @@ -692,12 +682,12 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { expr: &'tcx hir::Expr<'tcx>, ) -> Result<&'tcx hir::Expr<'tcx>, &'tcx hir::Expr<'tcx>> { match obligation_cause_code { - traits::ObligationCauseCode::ExprBindingObligation(_, _, _, _) => { + traits::ObligationCauseCode::WhereClauseInExpr(_, _, _, _) => { // This is the "root"; we assume that the `expr` is already pointing here. // Therefore, we return `Ok` so that this `expr` can be refined further. Ok(expr) } - traits::ObligationCauseCode::ImplDerivedObligation(impl_derived) => self + traits::ObligationCauseCode::ImplDerived(impl_derived) => self .blame_specific_expr_if_possible_for_derived_predicate_obligation( impl_derived, expr, @@ -735,7 +725,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { /// only a partial success - but it cannot be refined even further. fn blame_specific_expr_if_possible_for_derived_predicate_obligation( &self, - obligation: &traits::ImplDerivedObligationCause<'tcx>, + obligation: &traits::ImplDerivedCause<'tcx>, expr: &'tcx hir::Expr<'tcx>, ) -> Result<&'tcx hir::Expr<'tcx>, &'tcx hir::Expr<'tcx>> { // First, we attempt to refine the `expr` for our span using the parent obligation. @@ -880,10 +870,8 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { { // First, confirm that this struct is the same one as in the types, and if so, // find the right variant. - let Res::Def(expr_struct_def_kind, expr_struct_def_id) = self - .typeck_results - // .borrow() - .qpath_res(expr_struct_path, expr.hir_id) + let Res::Def(expr_struct_def_kind, expr_struct_def_id) = + self.typeck_results.qpath_res(expr_struct_path, expr.hir_id) else { return Err(expr); }; @@ -923,7 +911,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { let struct_generic_parameters: &ty::Generics = self.tcx.generics_of(in_ty_adt.did()); - if drill_generic_index >= struct_generic_parameters.params.len() { + if drill_generic_index >= struct_generic_parameters.own_params.len() { return Err(expr); } @@ -996,7 +984,6 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { let Res::Def(expr_struct_def_kind, expr_ctor_def_id) = self .typeck_results - // .borrow() .qpath_res(expr_callee_path, expr_callee.hir_id) else { return Err(expr); @@ -1053,7 +1040,7 @@ impl<'a, 'tcx: 'a> FnCtxtExt<'tcx> for FnCtxtSimulator<'a, 'tcx> { let struct_generic_parameters: &ty::Generics = self.tcx.generics_of(in_ty_adt.did()); - if drill_generic_index >= struct_generic_parameters.params.len() { + if drill_generic_index >= struct_generic_parameters.own_params.len() { return Err(expr); } diff --git a/crates/argus/src/rustc/mod.rs b/crates/argus/src/rustc/mod.rs index 0502184..71f7cf0 100644 --- a/crates/argus/src/rustc/mod.rs +++ b/crates/argus/src/rustc/mod.rs @@ -14,10 +14,13 @@ use rustc_infer::{ MismatchedProjectionTypes, PredicateObligation, SelectionError, }, }; -use rustc_middle::{ - ty, - ty::error::{ExpectedFound, TypeError}, +use rustc_middle::ty::{ + self, + error::{ExpectedFound, TypeError}, + ToPolyTraitRef, }; +use rustc_span::DUMMY_SP; +use rustc_trait_selection::{infer, traits::elaborate}; use crate::types::intermediate::EvaluationResult; @@ -30,12 +33,24 @@ macro_rules! bug { } pub trait InferCtxtExt<'tcx> { + fn can_match_projection( + &self, + goal: ty::ProjectionPredicate<'tcx>, + assumption: ty::PolyProjectionPredicate<'tcx>, + ) -> bool; + fn to_fulfillment_error( &self, obligation: &PredicateObligation<'tcx>, result: EvaluationResult, ) -> Option>; + fn can_match_trait( + &self, + goal: ty::TraitPredicate<'tcx>, + assumption: ty::PolyTraitPredicate<'tcx>, + ) -> bool; + fn error_implies( &self, cond: ty::Predicate<'tcx>, @@ -44,6 +59,26 @@ pub trait InferCtxtExt<'tcx> { } impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { + fn can_match_trait( + &self, + goal: ty::TraitPredicate<'tcx>, + assumption: ty::PolyTraitPredicate<'tcx>, + ) -> bool { + if goal.polarity != assumption.polarity() { + return false; + } + + let trait_goal = goal.trait_ref; + let trait_assumption = self.instantiate_binder_with_fresh_vars( + DUMMY_SP, + infer::BoundRegionConversionTime::HigherRankedType, + assumption.to_poly_trait_ref(), + ); + + self.can_eq(ty::ParamEnv::empty(), trait_goal, trait_assumption) + } + + // TODO: there is no longer a single `to_error` route so this is outdated. fn to_fulfillment_error( &self, obligation: &PredicateObligation<'tcx>, @@ -62,9 +97,9 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { // Taken from rustc_trait_selection::solve::fulfill.rs FulfillmentError { obligation: obligation.clone(), - code: match goal.predicate.kind().skip_binder() { + code: match obligation.predicate.kind().skip_binder() { ty::PredicateKind::Clause(ty::ClauseKind::Projection(_)) => { - FulfillmentErrorCode::ProjectionError( + FulfillmentErrorCode::Project( // FIXME: This could be a `Sorts` if the term is a type MismatchedProjectionTypes { err: TypeError::Mismatch, @@ -72,31 +107,31 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { ) } ty::PredicateKind::NormalizesTo(..) => { - FulfillmentErrorCode::ProjectionError(MismatchedProjectionTypes { + FulfillmentErrorCode::Project(MismatchedProjectionTypes { err: TypeError::Mismatch, }) } ty::PredicateKind::AliasRelate(_, _, _) => { - FulfillmentErrorCode::ProjectionError(MismatchedProjectionTypes { + FulfillmentErrorCode::Project(MismatchedProjectionTypes { err: TypeError::Mismatch, }) } ty::PredicateKind::Subtype(pred) => { - let (a, b) = infcx.instantiate_binder_with_placeholders( - goal.predicate.kind().rebind((pred.a, pred.b)), + let (a, b) = infcx.enter_forall_and_leak_universe( + obligation.predicate.kind().rebind((pred.a, pred.b)), ); let expected_found = ExpectedFound::new(true, a, b); - FulfillmentErrorCode::SubtypeError( + FulfillmentErrorCode::Subtype( expected_found, TypeError::Sorts(expected_found), ) } ty::PredicateKind::Coerce(pred) => { - let (a, b) = infcx.instantiate_binder_with_placeholders( - goal.predicate.kind().rebind((pred.a, pred.b)), + let (a, b) = infcx.enter_forall_and_leak_universe( + obligation.predicate.kind().rebind((pred.a, pred.b)), ); let expected_found = ExpectedFound::new(false, a, b); - FulfillmentErrorCode::SubtypeError( + FulfillmentErrorCode::Subtype( expected_found, TypeError::Sorts(expected_found), ) @@ -104,10 +139,10 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { ty::PredicateKind::Clause(_) | ty::PredicateKind::ObjectSafe(_) | ty::PredicateKind::Ambiguous => { - FulfillmentErrorCode::SelectionError(SelectionError::Unimplemented) + FulfillmentErrorCode::Select(SelectionError::Unimplemented) } ty::PredicateKind::ConstEquate(..) => { - bug!("unexpected goal: {goal:?}") + bug!("unexpected goal: {obligation:?}") } }, root_obligation: obligation, @@ -115,126 +150,45 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { ) } + fn can_match_projection( + &self, + goal: ty::ProjectionPredicate<'tcx>, + assumption: ty::PolyProjectionPredicate<'tcx>, + ) -> bool { + let assumption = self.instantiate_binder_with_fresh_vars( + DUMMY_SP, + infer::BoundRegionConversionTime::HigherRankedType, + assumption, + ); + + let param_env = ty::ParamEnv::empty(); + self.can_eq(param_env, goal.projection_term, assumption.projection_term) + && self.can_eq(param_env, goal.term, assumption.term) + } + fn error_implies( &self, cond: ty::Predicate<'tcx>, error: ty::Predicate<'tcx>, ) -> bool { - use rustc_middle::ty::ToPolyTraitRef; - use rustc_trait_selection::traits::elaborate; - if cond == error { return true; } - // FIXME: It should be possible to deal with `ForAll` in a cleaner way. - let bound_error = error.kind(); - let (cond, error) = - match (cond.kind().skip_binder(), bound_error.skip_binder()) { - ( - ty::PredicateKind::Clause(ty::ClauseKind::Trait(..)), - ty::PredicateKind::Clause(ty::ClauseKind::Trait(error)), - ) => (cond, bound_error.rebind(error)), - _ => { - // FIXME: make this work in other cases too. - return false; - } - }; - - for pred in elaborate(self.tcx, std::iter::once(cond)) { - let bound_predicate = pred.kind(); - if let ty::PredicateKind::Clause(ty::ClauseKind::Trait(implication)) = - bound_predicate.skip_binder() - { - let error = error.to_poly_trait_ref(); - let implication = bound_predicate.rebind(implication.trait_ref); - // FIXME: I'm just not taking associated types at all here. - // Eventually I'll need to implement param-env-aware - // `Γ₁ ⊦ φ₁ => Γ₂ ⊦ φ₂` logic. - let param_env = ty::ParamEnv::empty(); - if self.can_sub(param_env, error, implication) { - log::debug!( - "error_implies: {:?} -> {:?} -> {:?}", - cond, - error, - implication - ); - return true; - } - } - } - - false - } -} - -pub fn to_pretty_impl_header( - tcx: ty::TyCtxt<'_>, - impl_def_id: rustc_hir::def_id::DefId, -) -> Option { - use std::fmt::Write; - - use rustc_data_structures::fx::FxIndexSet; - use ty::GenericArgs; - - let trait_ref = tcx.impl_trait_ref(impl_def_id)?.instantiate_identity(); - let mut w = "impl".to_owned(); - - let args = GenericArgs::identity_for_item(tcx, impl_def_id); - - // FIXME: Currently only handles ?Sized. - // Needs to support ?Move and ?DynSized when they are implemented. - let mut types_without_default_bounds = FxIndexSet::default(); - let sized_trait = tcx.lang_items().sized_trait(); - - let arg_names = args - .iter() - .map(|k| k.to_string()) - .filter(|k| k != "'_") - .collect::>(); - if !arg_names.is_empty() { - types_without_default_bounds.extend(args.types()); - w.push('<'); - w.push_str(&arg_names.join(", ")); - w.push('>'); - } - - write!( - w, - " {} for {}", - trait_ref.print_only_trait_path(), - tcx.type_of(impl_def_id).instantiate_identity() - ) - .unwrap(); - - // The predicates will contain default bounds like `T: Sized`. We need to - // remove these bounds, and add `T: ?Sized` to any untouched type parameters. - let predicates = tcx.predicates_of(impl_def_id).predicates; - let mut pretty_predicates = - Vec::with_capacity(predicates.len() + types_without_default_bounds.len()); - - for (p, _) in predicates { - if let Some(poly_trait_ref) = p.as_trait_clause() { - if Some(poly_trait_ref.def_id()) == sized_trait { - // FIXME(#120456) - is `swap_remove` correct? - types_without_default_bounds - .swap_remove(&poly_trait_ref.self_ty().skip_binder()); - continue; - } + if let Some(error) = error.as_trait_clause() { + self.enter_forall(error, |error| { + elaborate(self.tcx, std::iter::once(cond)) + .filter_map(|implied| implied.as_trait_clause()) + .any(|implied| self.can_match_trait(error, implied)) + }) + } else if let Some(error) = error.as_projection_clause() { + self.enter_forall(error, |error| { + elaborate(self.tcx, std::iter::once(cond)) + .filter_map(|implied| implied.as_projection_clause()) + .any(|implied| self.can_match_projection(error, implied)) + }) + } else { + false } - pretty_predicates.push(p.to_string()); } - - pretty_predicates.extend( - types_without_default_bounds - .iter() - .map(|ty| format!("{ty}: ?Sized")), - ); - - if !pretty_predicates.is_empty() { - write!(w, "\n where {}", pretty_predicates.join(", ")).unwrap(); - } - - w.push(';'); - Some(w) } diff --git a/crates/argus/src/serialize/path/default.rs b/crates/argus/src/serialize/path/default.rs index 3701bbf..8c7b865 100644 --- a/crates/argus/src/serialize/path/default.rs +++ b/crates/argus/src/serialize/path/default.rs @@ -1,6 +1,5 @@ //! Default implementaitons from rustc_middle::ty::print -use log::debug; use rustc_data_structures::sso::SsoHashSet; use rustc_hir::{def_id::DefId, definitions::DefPathData}; use rustc_middle::ty::{self, *}; @@ -38,7 +37,7 @@ impl<'a, 'tcx: 'a> PathBuilderDefault<'tcx> for PathBuilder<'a, 'tcx> { args: &'tcx [GenericArg<'tcx>], ) { let key = self.tcx().def_key(def_id); - debug!("{:?}", key); + log::trace!("default_print_def_path {:?}", key); match key.disambiguated_data.data { DefPathData::CrateRoot => { @@ -87,7 +86,9 @@ impl<'a, 'tcx: 'a> PathBuilderDefault<'tcx> for PathBuilder<'a, 'tcx> { // If we have any generic arguments to print, we do that // on top of the same path, but without its own generics. _ => { - if !generics.params.is_empty() && args.len() >= generics.count() { + if !generics.own_params.is_empty() + && args.len() >= generics.count() + { let args = generics.own_args_no_defaults(self.tcx(), args); return self.path_generic_args( |cx| cx.print_def_path(def_id, parent_args), @@ -122,7 +123,6 @@ impl<'a, 'tcx: 'a> PathBuilderDefault<'tcx> for PathBuilder<'a, 'tcx> { ) } }; - debug!("Returning from default_print_def_path"); } fn print_impl_path( @@ -142,7 +142,7 @@ impl<'a, 'tcx: 'a> PathBuilderDefault<'tcx> for PathBuilder<'a, 'tcx> { self_ty: Ty<'tcx>, impl_trait_ref: Option>, ) { - debug!( + log::trace!( "default_print_impl_path: impl_def_id={:?}, self_ty={}, impl_trait_ref={:?}", impl_def_id, self_ty, impl_trait_ref ); @@ -203,11 +203,11 @@ fn characteristic_def_id_of_type_cached<'a>( ty::Dynamic(data, ..) => data.principal_def_id(), - ty::Array(subty, _) | ty::Slice(subty) => { + ty::Pat(subty, _) | ty::Array(subty, _) | ty::Slice(subty) => { characteristic_def_id_of_type_cached(subty, visited) } - ty::RawPtr(mt) => characteristic_def_id_of_type_cached(mt.ty, visited), + ty::RawPtr(ty, _) => characteristic_def_id_of_type_cached(ty, visited), ty::Ref(_, ty, _) => characteristic_def_id_of_type_cached(ty, visited), @@ -220,6 +220,7 @@ fn characteristic_def_id_of_type_cached<'a>( ty::FnDef(def_id, _) | ty::Closure(def_id, _) + | ty::CoroutineClosure(def_id, _) | ty::Coroutine(def_id, _) | ty::CoroutineWitness(def_id, _) | ty::Foreign(def_id) => Some(def_id), diff --git a/crates/argus/src/serialize/path/pretty.rs b/crates/argus/src/serialize/path/pretty.rs index 8ce8cf0..de1a759 100644 --- a/crates/argus/src/serialize/path/pretty.rs +++ b/crates/argus/src/serialize/path/pretty.rs @@ -280,7 +280,7 @@ impl<'a, 'tcx: 'a> PathBuilder<'a, 'tcx> { ) { print_prefix(self); - log::debug!("pretty_path_append_impl {:?} {:?}", self_ty, trait_ref); + log::trace!("pretty_path_append_impl {:?} {:?}", self_ty, trait_ref); self.generic_delimiters(|cx| { // CHANGE: define_scoped_cx!(cx); diff --git a/crates/argus/src/serialize/term.rs b/crates/argus/src/serialize/term.rs index 0830e38..2d36ab2 100644 --- a/crates/argus/src/serialize/term.rs +++ b/crates/argus/src/serialize/term.rs @@ -287,6 +287,7 @@ pub enum ExprDef<'tcx> { pub enum BinOpDef { Add, AddUnchecked, + Cmp, Sub, SubUnchecked, Mul, diff --git a/crates/argus/src/serialize/ty.rs b/crates/argus/src/serialize/ty.rs index fbffd7b..cc6af54 100644 --- a/crates/argus/src/serialize/ty.rs +++ b/crates/argus/src/serialize/ty.rs @@ -1,5 +1,5 @@ use rustc_data_structures::fx::FxIndexMap; -use rustc_hir::{self as hir, def::DefKind, def_id::DefId, LangItem, Unsafety}; +use rustc_hir::{self as hir, def::DefKind, def_id::DefId, LangItem, Safety}; use rustc_infer::traits::{ObligationCause, PredicateObligation}; use rustc_middle::{traits::util::supertraits_for_pretty_printing, ty}; use rustc_span::symbol::{kw, Symbol}; @@ -81,6 +81,12 @@ pub enum TyKindDef<'tcx> { #[cfg_attr(feature = "testing", ts(type = "FloatTy"))] ty::FloatTy, ), + Pat( + #[serde(with = "TyDef")] + #[cfg_attr(feature = "testing", ts(type = "Ty"))] + ty::Ty<'tcx>, + #[serde(skip)] ty::Pattern<'tcx>, + ), Adt(path::PathDefWithArgs<'tcx>), Str, Array( @@ -146,6 +152,7 @@ pub enum TyKindDef<'tcx> { Alias(AliasTyKindDef<'tcx>), Dynamic(DynamicTyKindDef<'tcx>), Coroutine(CoroutineTyKindDef<'tcx>), + CoroutineClosure(CoroutineClosureTyKindDef<'tcx>), CoroutineWitness(CoroutineWitnessTyKindDef<'tcx>), } @@ -158,6 +165,7 @@ impl<'tcx> From<&ty::TyKind<'tcx>> for TyKindDef<'tcx> { ty::TyKind::Uint(v) => Self::Uint(*v), ty::TyKind::Float(v) => Self::Float(*v), ty::TyKind::Str => Self::Str, + ty::TyKind::Pat(ty, pat) => Self::Pat(*ty, *pat), ty::TyKind::Adt(def, args) => { Self::Adt(path::PathDefWithArgs::new(def.did(), args)) } @@ -170,7 +178,10 @@ impl<'tcx> From<&ty::TyKind<'tcx>> for TyKindDef<'tcx> { ty::TyKind::Placeholder(v) => Self::Placeholder(*v), ty::TyKind::Error(_) => Self::Error, ty::TyKind::Infer(v) => Self::Infer(*v), - ty::TyKind::RawPtr(tam) => Self::RawPtr(*tam), + ty::TyKind::RawPtr(ty, mutbl) => Self::RawPtr(ty::TypeAndMut { + ty: *ty, + mutbl: *mutbl, + }), ty::TyKind::Foreign(d) => Self::Foreign(path::PathDefNoArgs::new(*d)), ty::TyKind::Closure(def_id, args) => { Self::Closure(path::PathDefWithArgs::new(*def_id, args)) @@ -187,6 +198,9 @@ impl<'tcx> From<&ty::TyKind<'tcx>> for TyKindDef<'tcx> { ty::TyKind::Coroutine(def_id, args) => { Self::Coroutine(CoroutineTyKindDef::new(*def_id, args)) } + ty::TyKind::CoroutineClosure(def_id, args) => { + Self::CoroutineClosure(CoroutineClosureTyKindDef::new(*def_id, args)) + } ty::TyKind::CoroutineWitness(def_id, args) => { Self::CoroutineWitness(CoroutineWitnessTyKindDef::new(*def_id, args)) } @@ -225,13 +239,15 @@ pub enum AliasTyKindDef<'tcx> { } impl<'tcx> AliasTyKindDef<'tcx> { - pub fn new(kind: ty::AliasKind, ty: ty::AliasTy<'tcx>) -> Self { + pub fn new(kind: ty::AliasTyKind, ty: ty::AliasTy<'tcx>) -> Self { let infcx = get_dynamic_ctx(); + log::debug!("Serializing type Alias {:?} {:?}", kind, ty); + match (kind, ty) { ( - ty::AliasKind::Projection - | ty::AliasKind::Inherent - | ty::AliasKind::Weak, + ty::AliasTyKind::Projection + | ty::AliasTyKind::Inherent + | ty::AliasTyKind::Weak, ref data, ) => { if !(infcx.should_print_verbose() || with_no_queries()) @@ -246,7 +262,7 @@ impl<'tcx> AliasTyKindDef<'tcx> { Self::AliasTy { data: *data } } } - (ty::AliasKind::Opaque, ty::AliasTy { def_id, args, .. }) => { + (ty::AliasTyKind::Opaque, ty::AliasTy { def_id, args, .. }) => { // We use verbose printing in 'NO_QUERIES' mode, to // avoid needing to call `predicates_of`. This should // only affect certain debug messages (e.g. messages printed @@ -427,6 +443,57 @@ impl<'tcx> CoroutineTyKindDef<'tcx> { } } +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +#[cfg_attr(feature = "testing", derive(TS))] +#[cfg_attr(feature = "testing", ts(export, rename = "CoroutineClosureTyKind"))] +pub struct CoroutineClosureTyKindDef<'tcx> { + path: path::PathDefWithArgs<'tcx>, + + #[serde(with = "TyDef")] + #[cfg_attr(feature = "testing", ts(type = "Ty"))] + closure_kind: ty::Ty<'tcx>, + + #[serde(with = "TyDef")] + #[cfg_attr(feature = "testing", ts(type = "Ty"))] + signature_parts: ty::Ty<'tcx>, + + #[serde(with = "TyDef")] + #[cfg_attr(feature = "testing", ts(type = "Ty"))] + upvar_tys: ty::Ty<'tcx>, + + #[serde(with = "TyDef")] + #[cfg_attr(feature = "testing", ts(type = "Ty"))] + captures_by_ref: ty::Ty<'tcx>, + + #[serde(with = "TyDef")] + #[cfg_attr(feature = "testing", ts(type = "Ty"))] + witness: ty::Ty<'tcx>, +} + +impl<'tcx> CoroutineClosureTyKindDef<'tcx> { + pub fn new( + def_id: DefId, + args: &'tcx ty::List>, + ) -> Self { + let closure_kind = args.as_coroutine_closure().kind_ty(); + let signature_parts = args.as_coroutine_closure().signature_parts_ty(); + let upvar_tys = args.as_coroutine_closure().tupled_upvars_ty(); + let captures_by_ref = + args.as_coroutine_closure().coroutine_captures_by_ref_ty(); + let witness = args.as_coroutine_closure().coroutine_witness_ty(); + + Self { + path: path::PathDefWithArgs::new(def_id, &*args), + closure_kind, + signature_parts, + upvar_tys, + captures_by_ref, + witness, + } + } +} + // ----------------------------------- // Coroutine witness definitions @@ -547,9 +614,9 @@ pub struct FnSigDef<'tcx> { pub inputs_and_output: &'tcx ty::List>, pub c_variadic: bool, - #[serde(with = "UnsafetyDef")] - #[cfg_attr(feature = "testing", ts(type = "Unsafety"))] - pub unsafety: Unsafety, + #[serde(with = "SafetyDef")] + #[cfg_attr(feature = "testing", ts(type = "Safety"))] + pub safety: Safety, #[serde(with = "AbiDef")] #[cfg_attr(feature = "testing", ts(type = "Abi"))] @@ -557,12 +624,12 @@ pub struct FnSigDef<'tcx> { } #[derive(Serialize)] -#[serde(remote = "Unsafety")] +#[serde(remote = "Safety")] #[cfg_attr(feature = "testing", derive(TS))] -#[cfg_attr(feature = "testing", ts(export, rename = "Unsafety"))] -pub enum UnsafetyDef { +#[cfg_attr(feature = "testing", ts(export, rename = "Safety"))] +pub enum SafetyDef { Unsafe, - Normal, + Safe, } #[derive(Serialize)] @@ -583,7 +650,6 @@ pub enum AbiDef { PtxKernel, Msp430Interrupt, X86Interrupt, - AmdGpuKernel, EfiApi, AvrInterrupt, AvrNonBlockingInterrupt, @@ -592,7 +658,6 @@ pub enum AbiDef { System { unwind: bool }, RustIntrinsic, RustCall, - PlatformIntrinsic, Unadjusted, RustCold, RiscvInterruptM, @@ -617,6 +682,27 @@ pub enum MovabilityDef { Movable, } +#[derive(Serialize)] +#[cfg_attr(feature = "testing", derive(TS))] +#[cfg_attr(feature = "testing", ts(export, rename = "AliasTerm"))] +pub struct AliasTermDef<'tcx>(path::PathDefWithArgs<'tcx>); + +impl<'tcx> AliasTermDef<'tcx> { + pub fn new(value: &ty::AliasTerm<'tcx>) -> Self { + Self(path::PathDefWithArgs::new(value.def_id, value.args)) + } + + pub fn serialize( + value: &ty::AliasTerm<'tcx>, + s: S, + ) -> Result + where + S: serde::Serializer, + { + Self::new(value).serialize(s) + } +} + #[derive(Serialize)] #[cfg_attr(feature = "testing", derive(TS))] #[cfg_attr(feature = "testing", ts(export, rename = "AliasTy"))] @@ -779,8 +865,10 @@ pub enum UintTyDef { #[cfg_attr(feature = "testing", derive(TS))] #[cfg_attr(feature = "testing", ts(export, rename = "FloatTy"))] pub enum FloatTyDef { + F16, F32, F64, + F128, } #[derive(Serialize)] @@ -945,19 +1033,14 @@ pub enum GenericArgKindDef<'tcx> { ), } -// TODO: gavinleroy +// TODO: gavinleroy we used to have a Named inference types (coming from binders) but that +// isn't the case anymore. Can we do any better or is the "Unnamed" variant sufficient for now? #[derive(Serialize)] #[cfg_attr(feature = "testing", derive(TS))] #[cfg_attr(feature = "testing", ts(export, rename = "InferTy"))] pub enum InferTyDef<'tcx> { IntVar, FloatVar, - Named( - #[serde(with = "SymbolDef")] - #[cfg_attr(feature = "testing", ts(type = "Symbol"))] - Symbol, - path::PathDefNoArgs<'tcx>, - ), Unnamed(path::PathDefNoArgs<'tcx>), SourceInfo(String), Unresolved, @@ -965,9 +1048,8 @@ pub enum InferTyDef<'tcx> { impl<'tcx> InferTyDef<'tcx> { pub fn new(value: &ty::InferTy) -> Self { - use rustc_infer::infer::type_variable::{ - TypeVariableOrigin, TypeVariableOriginKind::*, - }; + // See: `ty_getter` in `printer.ty_infer_name_resolver = Some(Box::new(ty_getter))` + // from: `rustc_infer::infer::error_reporting::need_type_info.rs` let infcx = get_dynamic_ctx(); let tcx = infcx.tcx; @@ -980,33 +1062,27 @@ impl<'tcx> InferTyDef<'tcx> { let ty = ty::Ty::new_infer(tcx, root_value); - match infcx.type_var_origin(ty) { - Some(TypeVariableOrigin { - kind: TypeParameterDefinition(name, def_id), - .. - }) => Self::Named(name, path::PathDefNoArgs::new(def_id)), - - Some(TypeVariableOrigin { - kind: OpaqueTypeInference(def_id), - .. - }) => Self::Unnamed(path::PathDefNoArgs::new(def_id)), - - Some(TypeVariableOrigin { span, .. }) if !span.is_dummy() => { - let span = span.source_callsite(); - if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(span) { - Self::SourceInfo(snippet) - } else { - Self::Unresolved - } + if let Some(origin) = infcx.type_var_origin(ty) + && let Some(def_id) = origin.param_def_id + { + Self::Unnamed(path::PathDefNoArgs::new(def_id)) + } else if let Some(origin) = infcx.type_var_origin(ty) + && !origin.span.is_dummy() + { + let span = origin.span.source_callsite(); + if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(span) { + Self::SourceInfo(snippet) + } else { + Self::Unresolved } - - _ => match value { + } else { + match value { ty::InferTy::IntVar(_) | ty::InferTy::FreshIntTy(_) => Self::IntVar, ty::InferTy::FloatVar(_) | ty::InferTy::FreshFloatTy(_) => { Self::FloatVar } ty::InferTy::TyVar(_) | ty::InferTy::FreshTy(_) => Self::Unresolved, - }, + } } } @@ -1229,9 +1305,9 @@ pub enum PredicateKindDef<'tcx> { #[cfg_attr(feature = "testing", derive(TS))] #[cfg_attr(feature = "testing", ts(export, rename = "NormalizesTo"))] pub struct NormalizesToDef<'tcx> { - #[serde(with = "AliasTyDef")] - #[cfg_attr(feature = "testing", ts(type = "AliasTy"))] - pub alias: ty::AliasTy<'tcx>, + #[serde(with = "AliasTermDef")] + #[cfg_attr(feature = "testing", ts(type = "AliasTerm"))] + pub alias: ty::AliasTerm<'tcx>, #[serde(with = "TermDef")] #[cfg_attr(feature = "testing", ts(type = "Term"))] @@ -1385,9 +1461,9 @@ pub struct TraitPredicateDef<'tcx> { pub trait_ref: TraitRefPrintSugaredDef<'tcx>, - #[serde(with = "ImplPolarityDef")] - #[cfg_attr(feature = "testing", ts(type = "ImplPolarity"))] - pub polarity: ty::ImplPolarity, + #[serde(with = "Polarity")] + #[cfg_attr(feature = "testing", ts(type = "Polarity"))] + pub polarity: ty::PredicatePolarity, } impl<'tcx> TraitPredicateDef<'tcx> { @@ -1465,12 +1541,74 @@ impl<'tcx> TraitRefPrintOnlyTraitPathDef<'tcx> { #[derive(Serialize)] #[cfg_attr(feature = "testing", derive(TS))] -#[cfg_attr(feature = "testing", ts(export, rename = "ImplPolarity"))] -#[serde(remote = "ty::ImplPolarity")] -pub enum ImplPolarityDef { +#[cfg_attr(feature = "testing", ts(export))] +pub enum Polarity { Positive, Negative, - Reservation, + Maybe, +} + +trait PolarityRepresentation { + fn is_positive(&self) -> bool; + fn is_negative(&self) -> bool; +} + +impl From for Polarity { + fn from(value: T) -> Self { + if value.is_positive() { + Self::Positive + } else if value.is_negative() { + Self::Negative + } else { + Self::Maybe + } + } +} + +macro_rules! impl_polarity_repr { + ([$p:ident, $n:ident], $( $t:path ),*) => {$( + impl PolarityRepresentation for $t { + fn is_positive(&self) -> bool { + matches!(self, <$t>::$p) + } + fn is_negative(&self) -> bool { + matches!(self, <$t>::$n) + } + } + + impl PolarityRepresentation for &$t { + fn is_positive(&self) -> bool { + matches!(self, <$t>::$p) + } + fn is_negative(&self) -> bool { + matches!(self, <$t>::$n) + } + } + )*} +} + +impl_polarity_repr! { + [Positive, Negative], + ty::ImplPolarity, + ty::PredicatePolarity +} + +impl Polarity { + fn serialize( + value: impl PolarityRepresentation, + s: S, + ) -> Result + where + S: serde::Serializer, + { + if value.is_positive() { + Self::Positive.serialize(s) + } else if value.is_negative() { + Self::Negative.serialize(s) + } else { + Self::Maybe.serialize(s) + } + } } #[derive(Serialize)] @@ -1526,9 +1664,9 @@ impl<'tcx> TyOutlivesRegionDef<'tcx> { #[cfg_attr(feature = "testing", derive(TS))] #[cfg_attr(feature = "testing", ts(export, rename = "ProjectionPredicate"))] pub struct ProjectionPredicateDef<'tcx> { - #[serde(with = "AliasTyDef")] - #[cfg_attr(feature = "testing", ts(type = "AliasTy"))] - pub projection_ty: ty::AliasTy<'tcx>, + #[serde(with = "AliasTermDef")] + #[cfg_attr(feature = "testing", ts(type = "AliasTerm"))] + pub projection_term: ty::AliasTerm<'tcx>, #[serde(with = "TermDef")] #[cfg_attr(feature = "testing", ts(type = "Term"))] @@ -1661,9 +1799,9 @@ pub struct FnTrait<'tcx> { #[cfg_attr(feature = "testing", derive(TS))] #[cfg_attr(feature = "testing", ts(export))] pub struct Trait<'tcx> { - #[serde(with = "ImplPolarityDef")] - #[cfg_attr(feature = "testing", ts(type = "ImplPolarity"))] - polarity: ty::ImplPolarity, + #[serde(with = "Polarity")] + #[cfg_attr(feature = "testing", ts(type = "Polarity"))] + polarity: ty::PredicatePolarity, #[cfg_attr(feature = "testing", ts(type = "DefinedPath"))] trait_name: TraitRefPrintOnlyTraitPathDef<'tcx>, #[serde(with = "Slice__GenericArgDef")] @@ -1688,10 +1826,10 @@ impl<'tcx> OpaqueImpl<'tcx> { fn insert_trait_and_projection( tcx: ty::TyCtxt<'tcx>, trait_ref: ty::PolyTraitRef<'tcx>, - polarity: ty::ImplPolarity, + polarity: ty::PredicatePolarity, proj_ty: Option<(DefId, ty::Binder<'tcx, ty::Term<'tcx>>)>, traits: &mut FxIndexMap< - (ty::PolyTraitRef<'tcx>, ty::ImplPolarity), + (ty::PolyTraitRef<'tcx>, ty::PredicatePolarity), FxIndexMap>>, >, fn_traits: &mut FxIndexMap, OpaqueFnEntry<'tcx>>, @@ -1701,7 +1839,7 @@ impl<'tcx> OpaqueImpl<'tcx> { // If our trait_ref is FnOnce or any of its children, project it onto the parent FnOnce // super-trait ref and record it there. // We skip negative Fn* bounds since they can't use parenthetical notation anyway. - if polarity == ty::ImplPolarity::Positive + if polarity == ty::PredicatePolarity::Positive && let Some(fn_once_trait) = tcx.lang_items().fn_once_trait() { // If we have a FnOnce, then insert it into @@ -1771,7 +1909,7 @@ impl<'tcx> OpaqueImpl<'tcx> { // by looking up the projections associated with the def_id. let bounds = tcx.explicit_item_bounds(def_id); - log::debug!("Explicit item bounds {:?}", bounds); + log::trace!("Explicit item bounds {:?}", bounds); let mut traits = FxIndexMap::default(); let mut fn_traits = FxIndexMap::default(); @@ -1789,11 +1927,13 @@ impl<'tcx> OpaqueImpl<'tcx> { // Don't print `+ Sized`, but rather `+ ?Sized` if absent. if Some(trait_ref.def_id()) == tcx.lang_items().sized_trait() { match pred.polarity { - ty::ImplPolarity::Positive | ty::ImplPolarity::Reservation => { + ty::PredicatePolarity::Positive => { has_sized_bound = true; continue; } - ty::ImplPolarity::Negative => has_negative_sized_bound = true, + ty::PredicatePolarity::Negative => { + has_negative_sized_bound = true + } } } @@ -1816,7 +1956,7 @@ impl<'tcx> OpaqueImpl<'tcx> { Self::insert_trait_and_projection( tcx, trait_ref, - ty::ImplPolarity::Positive, + ty::PredicatePolarity::Positive, Some(proj_ty), &mut traits, &mut fn_traits, @@ -1868,7 +2008,7 @@ impl<'tcx> OpaqueImpl<'tcx> { _ => { if entry.has_fn_once { traits - .entry((fn_once_trait_ref, ty::ImplPolarity::Positive)) + .entry((fn_once_trait_ref, ty::PredicatePolarity::Positive)) .or_default() .extend( // Group the return ty with its def id, if we had one. @@ -1879,12 +2019,12 @@ impl<'tcx> OpaqueImpl<'tcx> { } if let Some(trait_ref) = entry.fn_mut_trait_ref { traits - .entry((trait_ref, ty::ImplPolarity::Positive)) + .entry((trait_ref, ty::PredicatePolarity::Positive)) .or_default(); } if let Some(trait_ref) = entry.fn_trait_ref { traits - .entry((trait_ref, ty::ImplPolarity::Positive)) + .entry((trait_ref, ty::PredicatePolarity::Positive)) .or_default(); } } diff --git a/crates/argus/src/test_utils.rs b/crates/argus/src/test_utils.rs index 3ced6de..06bc8fb 100644 --- a/crates/argus/src/test_utils.rs +++ b/crates/argus/src/test_utils.rs @@ -1,7 +1,6 @@ use std::{env, fs, io, panic, path::Path, process::Command, sync::Arc}; use anyhow::{Context, Result}; -use rustc_errors::DiagCtxt; use rustc_hir::BodyId; use rustc_middle::ty::TyCtxt; use rustc_span::source_map::FileLoader; @@ -13,7 +12,6 @@ use rustc_utils::source_map::{ use crate::{ analysis, - emitter::SilentEmitter, proof_tree::SerializedTree, types::{ intermediate::{Forgettable, FullData}, @@ -243,8 +241,12 @@ where Cb: FnOnce(TyCtxt<'_>), { fn config(&mut self, config: &mut rustc_interface::Config) { - config.parse_sess_created = Some(Box::new(|sess| { - sess.dcx = DiagCtxt::with_emitter(SilentEmitter::boxed()); + config.psess_created = Some(Box::new(|sess| { + let fallback_bundle = rustc_errors::fallback_fluent_bundle( + rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), + false, + ); + sess.dcx.make_silent(fallback_bundle, None, false); })); } diff --git a/crates/argus/src/types.rs b/crates/argus/src/types.rs index 5f120b5..de21cf0 100644 --- a/crates/argus/src/types.rs +++ b/crates/argus/src/types.rs @@ -26,7 +26,7 @@ use crate::{ safe::{PathDefNoArgs, TraitRefPrintOnlyTraitPathDef}, serialize_to_value, ty::{ - ImplPolarityDef, RegionDef, Slice__ClauseDef, Slice__GenericArgDef, + Polarity, RegionDef, Slice__ClauseDef, Slice__GenericArgDef, Slice__TyDef, TyDef, }, }, @@ -310,9 +310,7 @@ pub struct ClauseWithBounds<'tcx> { #[cfg_attr(feature = "testing", ts(export))] pub enum ClauseBound<'tcx> { Trait( - #[serde(with = "ImplPolarityDef")] - #[cfg_attr(feature = "testing", ts(type = "ImplPolarity"))] - ty::ImplPolarity, + Polarity, #[cfg_attr(feature = "testing", ts(type = "TraitRefPrintOnlyTraitPath"))] TraitRefPrintOnlyTraitPathDef<'tcx>, ), @@ -412,6 +410,12 @@ impl From for ObligationHash { } } +impl From<&ObligationHash> for ObligationHash { + fn from(value: &Self) -> Self { + *value + } +} + impl, T: ToSpan> ToTarget for (U, T) { fn to_target(self, tcx: TyCtxt) -> Result { self.1.to_span(tcx).map(|span| Target { @@ -542,6 +546,7 @@ pub(super) mod intermediate { } } + #[allow(dead_code)] pub trait ForgetProvenance { type Target; fn forget(self) -> Self::Target; @@ -564,7 +569,7 @@ pub(super) mod intermediate { ) -> Result { let string = match value { Ok(Certainty::Yes) => "yes", - Ok(Certainty::Maybe(MaybeCause::Overflow)) => "maybe-overflow", + Ok(Certainty::Maybe(MaybeCause::Overflow { .. })) => "maybe-overflow", Ok(Certainty::Maybe(MaybeCause::Ambiguity)) => "maybe-ambiguity", Err(..) => "no", }; @@ -590,6 +595,7 @@ pub(super) mod intermediate { } } + #[allow(dead_code)] pub struct ErrorAssemblyCtx<'a, 'tcx: 'a> { pub tcx: TyCtxt<'tcx>, pub body_id: BodyId, diff --git a/crates/argus_cli/Cargo.toml b/crates/argus_cli/Cargo.toml index 7bbc7c6..58056ca 100644 --- a/crates/argus_cli/Cargo.toml +++ b/crates/argus_cli/Cargo.toml @@ -11,8 +11,8 @@ license = "MIT" [dependencies] argus-lib = { version = "0.1.6", path = "../argus" } -rustc_plugin = "=0.9.0-nightly-2024-01-24" -rustc_utils = { version = "=0.9.0-nightly-2024-01-24", features = ["serde"] } +rustc_plugin = "=0.10.0-nightly-2024-05-20" +rustc_utils = { version = "=0.10.0-nightly-2024-05-20", features = ["serde"] } # For binaries log = "0.4" diff --git a/crates/argus_cli/src/plugin.rs b/crates/argus_cli/src/plugin.rs index c836839..a207f7d 100644 --- a/crates/argus_cli/src/plugin.rs +++ b/crates/argus_cli/src/plugin.rs @@ -8,14 +8,12 @@ use std::{ use argus_lib::{ analysis, - emitter::SilentEmitter, ext::TyCtxtExt as ArgusTyCtxtExt, find_bodies::{find_bodies, find_enclosing_bodies}, types::{ObligationHash, ToTarget}, }; use clap::{Parser, Subcommand}; use fluid_let::fluid_set; -use rustc_errors::DiagCtxt; use rustc_hir::BodyId; use rustc_interface::interface::Result as RustcResult; use rustc_middle::ty::TyCtxt; @@ -37,6 +35,9 @@ const VERSION: &str = env!("CARGO_PKG_VERSION"); pub struct ArgusPluginArgs { #[clap(subcommand)] command: ArgusCommand, + + #[clap(long)] + show_stderr: bool, } #[derive(Subcommand, Serialize, Deserialize)] @@ -84,6 +85,7 @@ where } struct ArgusCallbacks Option> { + show_stderr: bool, file: Option, analysis: Option, compute_target: Option, @@ -159,7 +161,7 @@ impl RustcPlugin for ArgusPlugin { plugin_args: ArgusPluginArgs, ) -> RustcResult<()> { use ArgusCommand::*; - match plugin_args.command { + match &plugin_args.command { Tree { file, id, @@ -167,8 +169,6 @@ impl RustcPlugin for ArgusPlugin { start_column, end_line, end_column, - - // TODO: we dono't yet handle synthetic queries in Argus. is_synthetic, } => { let is_synthetic = is_synthetic.unwrap_or(false); @@ -177,12 +177,12 @@ impl RustcPlugin for ArgusPlugin { id, CharRange { start: CharPos { - line: start_line, - column: start_column, + line: *start_line, + column: *start_column, }, end: CharPos { - line: end_line, - column: end_column, + line: *end_line, + column: *end_column, }, filename: Filename::intern(&file), }, @@ -194,6 +194,7 @@ impl RustcPlugin for ArgusPlugin { analysis::tree, Some(PathBuf::from(&file)), compute_target, + &plugin_args, &compiler_args, ); postprocess(v) @@ -202,15 +203,22 @@ impl RustcPlugin for ArgusPlugin { let nothing = || None::<(ObligationHash, CharRange)>; let v = run( analysis::obligations, - file.map(PathBuf::from), + file.as_ref().map(PathBuf::from), nothing, + &plugin_args, &compiler_args, ); postprocess(v) } Bundle => { let nothing = || None::<(ObligationHash, CharRange)>; - let v = run(analysis::bundle, None, nothing, &compiler_args); + let v = run( + analysis::bundle, + None, + nothing, + &plugin_args, + &compiler_args, + ); postprocess(v) } _ => unreachable!(), @@ -222,10 +230,12 @@ fn run( analysis: A, file: Option, compute_target: impl FnOnce() -> Option + Send, + plugin_args: &ArgusPluginArgs, args: &[String], ) -> ArgusResult> { let mut callbacks = ArgusCallbacks { file, + show_stderr: plugin_args.show_stderr, analysis: Some(analysis), compute_target: Some(compute_target), result: Vec::default(), @@ -275,18 +285,17 @@ impl Option> rustc_driver::Callbacks for ArgusCallbacks { fn config(&mut self, config: &mut rustc_interface::Config) { - config.parse_sess_created = Some(Box::new(|sess| { - // // Create a new emitter writer which consumes *silently* all - // // errors. There most certainly is a *better* way to do this, - // // if you, the reader, know what that is, please open an issue :) - // let fallback_bundle = rustc_errors::fallback_fluent_bundle( - // rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), - // false, - // ); - // let emitter = HumanEmitter::new(Box::new(io::sink()), fallback_bundle); - // sess.dcx = DiagCtxt::with_emitter(Box::new(emitter)); - - sess.dcx = DiagCtxt::with_emitter(SilentEmitter::boxed()); + if self.show_stderr { + return; + } + + config.psess_created = Some(Box::new(|sess| { + let fallback_bundle = rustc_errors::fallback_fluent_bundle( + rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), + false, + ); + + sess.dcx.make_silent(fallback_bundle, None, false); })); } diff --git a/crates/argus_cli/tests/workspaces/axum/src/tests/not_send.rs b/crates/argus_cli/tests/workspaces/axum/src/tests/not_send.rs index 7c0ec9a..b1822ed 100644 --- a/crates/argus_cli/tests/workspaces/axum/src/tests/not_send.rs +++ b/crates/argus_cli/tests/workspaces/axum/src/tests/not_send.rs @@ -7,3 +7,4 @@ async fn handler() { async fn test() { crate::use_as_handler!(handler); } + diff --git a/crates/argus_cli/tests/workspaces/bevy/Cargo.lock b/crates/argus_cli/tests/workspaces/bevy/Cargo.lock index c4eb317..9ddc3bf 100644 --- a/crates/argus_cli/tests/workspaces/bevy/Cargo.lock +++ b/crates/argus_cli/tests/workspaces/bevy/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.23" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" +checksum = "2e53b0a3d5760cd2ba9b787ae0c6440ad18ee294ff71b05e3381c900a7d16cfd" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -20,66 +20,58 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "accesskit" -version = "0.10.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704d532b1cd3d912bb37499c55a81ac748cc1afa737eedd100ba441acdd47d38" +checksum = "74a4b14f3d99c1255dcba8f45621ab1a2e7540a0009652d33989005a4d0bfc6b" [[package]] name = "accesskit_consumer" -version = "0.14.1" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ba8b23cfca3944012ee2e5c71c02077a400e034c720eed6bd927cb6b4d1fd9" +checksum = "8c17cca53c09fbd7288667b22a201274b9becaa27f0b91bf52a526db95de45e6" dependencies = [ "accesskit", ] [[package]] name = "accesskit_macos" -version = "0.6.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d062544d6cc36f4213323b7cb3a0d74ddff4b0d2311ab5e7596f4278bb2cc9" +checksum = "cd3b6ae1eabbfbced10e840fd3fce8a93ae84f174b3e4ba892ab7bcb42e477a7" dependencies = [ "accesskit", "accesskit_consumer", - "objc2", + "objc2 0.3.0-beta.3.patch-leaks.3", "once_cell", ] [[package]] name = "accesskit_windows" -version = "0.13.2" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf5b3c3828397ee832ba4a72fb1a4ace10f781e31885f774cbd531014059115" +checksum = "afcae27ec0974fc7c3b0b318783be89fd1b2e66dd702179fe600166a38ff4a0b" dependencies = [ "accesskit", "accesskit_consumer", - "arrayvec", "once_cell", "paste", - "windows 0.44.0", + "static_assertions", + "windows 0.48.0", ] [[package]] name = "accesskit_winit" -version = "0.12.4" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcb615217efc79c4bed3094c4ca76c4bc554751d1da16f3ed4ba0459b1e8f31" +checksum = "45f8f7c9f66d454d5fd8e344c8c8c7324b57194e1041b955519fc58a01e77a25" dependencies = [ "accesskit", "accesskit_macos", "accesskit_windows", + "raw-window-handle", "winit", ] -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - [[package]] name = "adler" version = "1.0.2" @@ -88,22 +80,12 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -111,29 +93,28 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alsa" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2562ad8dcf0f789f65c6fdaad8a8a9708ed6b488e649da28c01656ad66b8b47" +checksum = "37fe60779335388a88c01ac6c3be40304d1e349de3ada3b15f7808bb90fa9dce" dependencies = [ "alsa-sys", - "bitflags 1.3.2", + "bitflags 2.5.0", "libc", - "nix 0.24.3", ] [[package]] @@ -148,20 +129,23 @@ dependencies = [ [[package]] name = "android-activity" -version = "0.4.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64529721f27c2314ced0890ce45e469574a73e5e6fdd6e9da1860eb29285f5e0" +checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" dependencies = [ "android-properties", - "bitflags 1.3.2", + "bitflags 2.5.0", "cc", + "cesu8", + "jni", "jni-sys", "libc", "log", "ndk", "ndk-context", "ndk-sys", - "num_enum 0.6.1", + "num_enum", + "thiserror", ] [[package]] @@ -172,9 +156,9 @@ checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" [[package]] name = "android_log-sys" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" +checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" [[package]] name = "android_system_properties" @@ -185,12 +169,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anyhow" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" - [[package]] name = "approx" version = "0.5.1" @@ -200,12 +178,24 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + [[package]] name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + [[package]] name = "ash" version = "0.37.3+1.3.251" @@ -215,31 +205,52 @@ dependencies = [ "libloading 0.7.4", ] +[[package]] +name = "async-broadcast" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" +dependencies = [ + "event-listener 2.5.3", + "futures-core", +] + [[package]] name = "async-channel" -version = "1.9.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 2.5.3", + "event-listener-strategy 0.5.2", "futures-core", + "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" dependencies = [ - "async-lock", "async-task", "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.2.0", + "fastrand", + "futures-lite", "slab", ] +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + [[package]] name = "async-lock" version = "3.3.0" @@ -247,42 +258,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener 4.0.3", - "event-listener-strategy", + "event-listener-strategy 0.4.0", "pin-project-lite", ] [[package]] name = "async-task" -version = "4.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" - -[[package]] -name = "autocfg" -version = "1.1.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] -name = "backtrace" -version = "0.3.69" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] -name = "base64" -version = "0.13.1" +name = "autocfg" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "base64" @@ -292,9 +288,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bevy" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93f906133305915d63f04108e6873c1b93a6605fe374b8f3391f6bda093e396" +checksum = "65b9eadaacf8fe971331bc3f250f35c18bc9dace3f96b483062f38ac07e3a1b4" dependencies = [ "bevy_internal", ] @@ -308,9 +304,9 @@ dependencies = [ [[package]] name = "bevy_a11y" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037c4063f7dac1a5d596eb47f40782a04ca5838dc4274dbbadc90eb81efe5169" +checksum = "cd8ef2795f7f5c816a4eda04834083eb5a92e8fef603bc21d2091c6e3b63621a" dependencies = [ "accesskit", "bevy_app", @@ -320,9 +316,9 @@ dependencies = [ [[package]] name = "bevy_animation" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0dc19f21846ebf8ba4d96617c2517b5119038774aa5dbbaf1bff122332b359c" +checksum = "e553d68bc937586010ed2194ac66b751bc6238cf622b3ed5a86f4e1581e94509" dependencies = [ "bevy_app", "bevy_asset", @@ -331,6 +327,7 @@ dependencies = [ "bevy_hierarchy", "bevy_math", "bevy_reflect", + "bevy_render", "bevy_time", "bevy_transform", "bevy_utils", @@ -338,13 +335,14 @@ dependencies = [ [[package]] name = "bevy_app" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01db46963eb9486f7884121527ec69751d0e448f9e1d5329e80ea3424118a31a" +checksum = "ab348a32e46d21c5d61794294a92d415a770d26c7ba8951830b127b40b53ccc4" dependencies = [ "bevy_derive", "bevy_ecs", "bevy_reflect", + "bevy_tasks", "bevy_utils", "downcast-rs", "wasm-bindgen", @@ -353,25 +351,29 @@ dependencies = [ [[package]] name = "bevy_asset" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98609b4b0694a23bde0628aed626644967991f167aad9db2afb68dacb0017540" +checksum = "50028e0d4f28a9f6aab48f61b688ba2793141188f88cdc9aa6c2bca2cc02ad35" dependencies = [ - "anyhow", + "async-broadcast", + "async-fs", + "async-lock", "bevy_app", - "bevy_diagnostic", + "bevy_asset_macros", "bevy_ecs", "bevy_log", "bevy_reflect", "bevy_tasks", "bevy_utils", "bevy_winit", + "blake3", "crossbeam-channel", "downcast-rs", - "fastrand 1.9.0", + "futures-io", + "futures-lite", "js-sys", - "notify", "parking_lot", + "ron", "serde", "thiserror", "wasm-bindgen", @@ -379,30 +381,41 @@ dependencies = [ "web-sys", ] +[[package]] +name = "bevy_asset_macros" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6617475908368418d815360148fdbb82f879dc255a70d2d7baa3766f0cd4bfd7" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn 2.0.65", +] + [[package]] name = "bevy_audio" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42b9f9b87b0d094268ce52bb75ff346ae0054573f7acc5d66bf032e2c88f748d" +checksum = "b0f12495e230cd5cf59c6051cdd820c97d7fe4f0597d4d9c3240c62e9c65b485" dependencies = [ - "anyhow", "bevy_app", "bevy_asset", + "bevy_derive", "bevy_ecs", "bevy_math", "bevy_reflect", "bevy_transform", "bevy_utils", - "oboe", - "parking_lot", + "cpal", "rodio", ] [[package]] name = "bevy_core" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee53d7b4691b57207d72e996992c995a53f3e8d21ca7151ca3956d9ce7d232e" +checksum = "12b0042f241ba7cd61487aadd8addfb56f7eeb662d713ac1577026704508fc6c" dependencies = [ "bevy_app", "bevy_ecs", @@ -415,40 +428,42 @@ dependencies = [ [[package]] name = "bevy_core_pipeline" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093ae5ced77251602ad6e43521e2acc1a5570bf85b80f232f1a7fdd43b50f8d8" +checksum = "48b7a471cb8ba665f12f7a167faa5566c11386f5bfc77d2e10bfde22b179f7b3" dependencies = [ "bevy_app", "bevy_asset", + "bevy_core", "bevy_derive", "bevy_ecs", + "bevy_log", "bevy_math", "bevy_reflect", "bevy_render", "bevy_transform", "bevy_utils", - "bitflags 1.3.2", + "bitflags 2.5.0", "radsort", "serde", ] [[package]] name = "bevy_derive" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff0add5ab4a6b2b7e86e18f9043bb48b6386faa3b56abaa0ed97a3d669a1992" +checksum = "f0e01f8343f391e2d6a63b368b82fb5b252ed43c8713fc87f9a8f2d59407dd00" dependencies = [ "bevy_macro_utils", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] name = "bevy_diagnostic" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c778422643b0adee9e82abbd07e1e906eb9947c274a9b18e0f7fbf137d4c34" +checksum = "e1401cdccec7e49378d013dfb0ff62c251f85b3be19dcdf04cfd827f793d1ee9" dependencies = [ "bevy_app", "bevy_core", @@ -456,14 +471,15 @@ dependencies = [ "bevy_log", "bevy_time", "bevy_utils", + "const-fnv1a-hash", "sysinfo", ] [[package]] name = "bevy_ecs" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed2f74687ccf13046c0f8e3b00dc61d7e656877b4a1380cf04635bb74d8e586" +checksum = "98e612a8e7962ead849e370f3a7e972b88df879ced05cd9dad6a0286d14650cf" dependencies = [ "async-channel", "bevy_ecs_macros", @@ -472,30 +488,30 @@ dependencies = [ "bevy_tasks", "bevy_utils", "downcast-rs", - "event-listener 2.5.3", "fixedbitset", "rustc-hash", "serde", + "thiserror", "thread_local", ] [[package]] name = "bevy_ecs_macros" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97fd126a0db7b30fb1833614b3a657b44ac88485741c33b2780e25de0f96d78" +checksum = "807b5106c3410e58f4f523b55ea3c071e2a09e31e9510f3c22021c6a04732b5b" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] name = "bevy_encase_derive" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c086ebdc1f5522787d63772943277cc74a279445fb65db4d58c2c5330654648e" +checksum = "887087a5e522d9f20733a84dd7e6e9ca04cd8fdfac659220ed87d675eebc83a7" dependencies = [ "bevy_macro_utils", "encase_derive_impl", @@ -503,25 +519,61 @@ dependencies = [ [[package]] name = "bevy_gilrs" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f32eb07e8c9ea4be7195ccec10d8f9ad70200f3ae2e13adc4b84df9f50bb1c6" +checksum = "7d133c65ab756f130c65cf00f37dc293fb9a9336c891802baf006c63e300d0e2" dependencies = [ "bevy_app", "bevy_ecs", "bevy_input", + "bevy_log", + "bevy_time", "bevy_utils", "gilrs", + "thiserror", +] + +[[package]] +name = "bevy_gizmos" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054df3550a9d423a961de65b459946ff23304f97f25af8a62c23f4259db8506d" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_core", + "bevy_core_pipeline", + "bevy_ecs", + "bevy_gizmos_macros", + "bevy_log", + "bevy_math", + "bevy_pbr", + "bevy_reflect", + "bevy_render", + "bevy_sprite", + "bevy_transform", + "bevy_utils", +] + +[[package]] +name = "bevy_gizmos_macros" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abdcaf74d8cd34aa5c3293527e7a012826840886ad3496c1b963ed8b66b1619f" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn 2.0.65", ] [[package]] name = "bevy_gltf" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2707632208617c3660ea7a1d2ef2ccc84b59f217c2f01a1d0abe81db4ae7bbde" +checksum = "21ecf404295055deb7fe037495891bc135ca10d46bc5b6c55f9ab7b7ebc61d31" dependencies = [ - "anyhow", - "base64 0.13.1", + "base64", "bevy_animation", "bevy_app", "bevy_asset", @@ -540,14 +592,16 @@ dependencies = [ "bevy_utils", "gltf", "percent-encoding", + "serde", + "serde_json", "thiserror", ] [[package]] name = "bevy_hierarchy" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d04099865a13d1fd8bf3c044a80148cb3d23bfe8c3d5f082dda2ce091d85532" +checksum = "bbb3dfad24866a6713dafa3065a91c5cf5e355f6e1b191c25d704ae54185246c" dependencies = [ "bevy_app", "bevy_core", @@ -555,28 +609,28 @@ dependencies = [ "bevy_log", "bevy_reflect", "bevy_utils", - "smallvec", ] [[package]] name = "bevy_input" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15d40aa636bb656967ac16ca36066ab7a7bb9179e1b0390c5705e54208e8fd7" +checksum = "47f2b2b3df168c6ef661d25e09abf5bd4fecaacd400f27e5db650df1c3fa3a3b" dependencies = [ "bevy_app", "bevy_ecs", "bevy_math", "bevy_reflect", "bevy_utils", + "smol_str", "thiserror", ] [[package]] name = "bevy_internal" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862b11931c5874cb00778ffb715fc526ee49e52a493d3bcf50e8010f301858b3" +checksum = "f58ec0ce77603df9474cde61f429126bfe06eb79094440e9141afb4217751c79" dependencies = [ "bevy_a11y", "bevy_animation", @@ -589,6 +643,7 @@ dependencies = [ "bevy_diagnostic", "bevy_ecs", "bevy_gilrs", + "bevy_gizmos", "bevy_gltf", "bevy_hierarchy", "bevy_input", @@ -612,9 +667,9 @@ dependencies = [ [[package]] name = "bevy_log" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25980c90ceaad34d09a53291e72ca56fcc754a974cd4654fffcf5b68b283b7a7" +checksum = "a5eea6c527fd828b7fef8d0f518167f27f405b904a16f227b644687d3f46a809" dependencies = [ "android_log-sys", "bevy_app", @@ -628,20 +683,22 @@ dependencies = [ [[package]] name = "bevy_macro_utils" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b2fee53b2497cdc3bffff2ddf52afa751242424a5fd0d51d227d4dab081d0d9" +checksum = "eb270c98a96243b29465139ed10bda2f675d00a11904f6588a5f7fc4774119c7" dependencies = [ + "proc-macro2", "quote", - "syn 1.0.109", + "rustc-hash", + "syn 2.0.65", "toml_edit", ] [[package]] name = "bevy_math" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6a1109d06fe947990db032e719e162414cf9bf7a478dcc52742f1c7136c42a" +checksum = "f06daa26ffb82d90ba772256c0ba286f6c305c392f6976c9822717974805837c" dependencies = [ "glam", "serde", @@ -649,18 +706,18 @@ dependencies = [ [[package]] name = "bevy_mikktspace" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39106bc2ee21fce9496d2e15e0ba7925dff63e3eae10f7c1fc0094b56ad9f2bb" +checksum = "a0d7ef7f2a826d0b19f059035831ce00a5e930435cc53c61e045773d0483f67a" dependencies = [ "glam", ] [[package]] name = "bevy_pbr" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f507cef55812aa70c2ec2b30fb996eb285fa7497d974cf03f76ec49c77fbe27" +checksum = "75b29c80269fa6db55c9e33701edd3ecb73d8866ca8cb814d49a9d3fb72531b6" dependencies = [ "bevy_app", "bevy_asset", @@ -673,22 +730,25 @@ dependencies = [ "bevy_transform", "bevy_utils", "bevy_window", - "bitflags 1.3.2", + "bitflags 2.5.0", "bytemuck", + "fixedbitset", "radsort", + "smallvec", + "thread_local", ] [[package]] name = "bevy_ptr" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b88451d4c5a353bff67dbaa937b6886efd26ae114769c17f2b35099c7a4de" +checksum = "8050e2869fe341db6874203b5a01ff12673807a2c7c80cb829f6c7bea6997268" [[package]] name = "bevy_reflect" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc3979471890e336f3ba87961ef3ecd45c331cf2cb2f582c885e541af228b48" +checksum = "ccbd7de21d586457a340a0962ad0747dc5098ff925eb6b27a918c4bdd8252f7b" dependencies = [ "bevy_math", "bevy_ptr", @@ -697,34 +757,30 @@ dependencies = [ "downcast-rs", "erased-serde", "glam", - "once_cell", - "parking_lot", "serde", - "smallvec", + "smol_str", "thiserror", ] [[package]] name = "bevy_reflect_derive" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc7ea7c9bc2c531eb29ba5619976613d6680453ff5dd4a7fcd08848e8bec5ad" +checksum = "3ce33051bd49036d4a5a62aa3f2068672ec55f3ebe92aa0d003a341f15cc37ac" dependencies = [ "bevy_macro_utils", - "bit-set", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", "uuid", ] [[package]] name = "bevy_render" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee1e126226f0a4d439bf82fe07c1104f894a6a365888e3eba7356f9647e77a83" +checksum = "88b2c4b644c739c0b474b6f8f7b0bc68ac13d83b59688781e9a7753c52780177" dependencies = [ - "anyhow", "async-channel", "bevy_app", "bevy_asset", @@ -743,46 +799,45 @@ dependencies = [ "bevy_transform", "bevy_utils", "bevy_window", - "bitflags 1.3.2", + "bitflags 2.5.0", + "bytemuck", "codespan-reporting", "downcast-rs", "encase", - "futures-lite 1.13.0", + "futures-lite", "hexasphere", "image", + "js-sys", "ktx2", "naga", - "once_cell", - "parking_lot", - "regex", + "naga_oil", "ruzstd", "serde", - "smallvec", "thiserror", "thread_local", + "wasm-bindgen", + "web-sys", "wgpu", - "wgpu-hal", ] [[package]] name = "bevy_render_macros" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "652f8c4d9577c6e6a8b3dfd8a4ce331e8b6ecdbb99636a4b2701dec50104d6bc" +checksum = "720b88406e786e378829b7d43c1ffb5300186912b99904d0d4d8ec6698a4f210" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] name = "bevy_scene" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de59637d27726251091120ce6f63917328ffd60aaccbda4d65a615873aff631" +checksum = "1f3d2caa1bfe7542dbe2c62e1bcc10791ba181fb744d2fe6711d1d373354da7c" dependencies = [ - "anyhow", "bevy_app", "bevy_asset", "bevy_derive", @@ -792,7 +847,6 @@ dependencies = [ "bevy_render", "bevy_transform", "bevy_utils", - "ron", "serde", "thiserror", "uuid", @@ -800,9 +854,9 @@ dependencies = [ [[package]] name = "bevy_sprite" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c110358fe3651a5796fd1c07989635680738f5b5c7e9b8a463dd50d12bb78410" +checksum = "8cad1b555161f50e5d62b7fdf7ebeef1b24338aae7a88e51985da9553cd60ddf" dependencies = [ "bevy_app", "bevy_asset", @@ -815,37 +869,36 @@ dependencies = [ "bevy_render", "bevy_transform", "bevy_utils", - "bitflags 1.3.2", + "bitflags 2.5.0", "bytemuck", "fixedbitset", "guillotiere", + "radsort", "rectangle-pack", "thiserror", ] [[package]] name = "bevy_tasks" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3de86364316e151aeb0897eaaa917c3ad5ee5ef1471a939023cf7f2d5ab76955" +checksum = "f07fcc4969b357de143509925b39c9a2c56eaa8750828d97f319ca9ed41897cb" dependencies = [ "async-channel", "async-executor", "async-task", "concurrent-queue", - "futures-lite 1.13.0", - "once_cell", + "futures-lite", "wasm-bindgen-futures", ] [[package]] name = "bevy_text" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "995188f59dc06da3fc951e1f58a105cde2c817d5330ae67ddc0a140f46482f6b" +checksum = "c4e8456ae0bea7d6b7621e42c1c12bf66c0891381e62c948ab23920673ce611c" dependencies = [ "ab_glyph", - "anyhow", "bevy_app", "bevy_asset", "bevy_ecs", @@ -863,9 +916,9 @@ dependencies = [ [[package]] name = "bevy_time" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3edbd605df1bced312eb9888d6be3d5a5fcac3d4140038bbe3233d218399eef" +checksum = "38ea5ae9fe7f56f555dbb05a88d34931907873e3f0c7dc426591839eef72fe3e" dependencies = [ "bevy_app", "bevy_ecs", @@ -877,22 +930,23 @@ dependencies = [ [[package]] name = "bevy_transform" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24383dfb97d8a14b17721ecfdf58556eff5ea9a4b2a3d91accf2b472783880b0" +checksum = "a0d51a1f332cc00939d2f19ed6b909e5ed7037e39c7e25cc86930d79d432163e" dependencies = [ "bevy_app", "bevy_ecs", "bevy_hierarchy", "bevy_math", "bevy_reflect", + "thiserror", ] [[package]] name = "bevy_ui" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb597aeed4e1bf5e6913879c3e22a7d50a843b822a7f71a4a80ebdfdf79e68d4" +checksum = "b6bbc30be39cfbfa3a073b541d22aea43ab14452dea12d7411ce201df17ff7b1" dependencies = [ "bevy_a11y", "bevy_app", @@ -912,46 +966,47 @@ dependencies = [ "bevy_utils", "bevy_window", "bytemuck", - "serde", - "smallvec", "taffy", "thiserror", ] [[package]] name = "bevy_utils" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a88ebbca55d360d72e9fe78df0d22e25cd419933c9559e79dae2757f7c4d066" +checksum = "5a9f845a985c00e0ee8dc2d8af3f417be925fb52aad4bda5b96e2e58a2b4d2eb" dependencies = [ - "ahash 0.7.7", + "ahash", "bevy_utils_proc_macros", "getrandom", - "hashbrown 0.12.3", - "instant", + "hashbrown", + "nonmax", "petgraph", + "smallvec", "thiserror", "tracing", "uuid", + "web-time", ] [[package]] name = "bevy_utils_proc_macros" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630b92e32fa5cd7917c7d4fdbf63a90af958b01e096239f71bc4f8f3cf40c0d2" +checksum = "bef158627f30503d5c18c20c60b444829f698d343516eeaf6eeee078c9a45163" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] name = "bevy_window" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad31234754268fbe12050290b0496e2296252a16995a38f94bfb9680a4f09fda" +checksum = "976202d2ed838176595b550ac654b15ae236e0178a6f19a94ca6d58f2a96ca60" dependencies = [ + "bevy_a11y", "bevy_app", "bevy_ecs", "bevy_input", @@ -959,13 +1014,14 @@ dependencies = [ "bevy_reflect", "bevy_utils", "raw-window-handle", + "smol_str", ] [[package]] name = "bevy_winit" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf17bd6330f7e633b7c56754c776511a8f52cde4bf54c0278f34d7527548f253" +checksum = "aa66539aa93d8522b146bf82de429714ea6370a6061fc1f1ff7bcacd4e64c6c4" dependencies = [ "accesskit_winit", "approx", @@ -976,10 +1032,10 @@ dependencies = [ "bevy_hierarchy", "bevy_input", "bevy_math", + "bevy_tasks", "bevy_utils", "bevy_window", "crossbeam-channel", - "once_cell", "raw-window-handle", "wasm-bindgen", "web-sys", @@ -992,7 +1048,7 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cexpr", "clang-sys", "itertools", @@ -1003,7 +1059,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -1029,13 +1085,26 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] +[[package]] +name = "blake3" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + [[package]] name = "block" version = "0.1.6" @@ -1048,7 +1117,16 @@ version = "0.1.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" dependencies = [ - "objc-sys", + "objc-sys 0.2.0-beta.2", +] + +[[package]] +name = "block-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" +dependencies = [ + "objc-sys 0.3.3", ] [[package]] @@ -1057,34 +1135,58 @@ version = "0.2.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" dependencies = [ - "block-sys", - "objc2-encode", + "block-sys 0.1.0-beta.1", + "objc2-encode 2.0.0-pre.2", +] + +[[package]] +name = "block2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" +dependencies = [ + "block-sys 0.2.1", + "objc2 0.4.1", +] + +[[package]] +name = "blocking" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "futures-io", + "futures-lite", + "piper", ] [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.14.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea31d69bda4949c1c1562c1e6f042a1caefac98cdc8a298260a2ff41c1e2d42b" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -1095,18 +1197,33 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "calloop" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" +dependencies = [ + "bitflags 2.5.0", + "log", + "polling", + "rustix", + "slab", + "thiserror", +] [[package]] name = "cc" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -1144,7 +1261,7 @@ checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", - "libloading 0.8.1", + "libloading 0.8.3", ] [[package]] @@ -1164,16 +1281,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] -name = "com-rs" -version = "0.2.1" +name = "com" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", @@ -1181,9 +1323,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -1198,12 +1340,39 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "const-fnv1a-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca" + [[package]] name = "const_panic" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6051f239ecec86fde3410901ab7860d458d160371533842974fc61f96d15879b" +[[package]] +name = "const_soft_float" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ca1caa64ef4ed453e68bb3db612e51cf1b2f5b871337f0fcab1c8f87cc3dff" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "constgebra" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1aaf9b65849a68662ac6c0810c8893a765c960b907dd7cfab9c4a50bf764fbc" +dependencies = [ + "const_soft_float", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1222,9 +1391,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" -version = "0.22.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -1266,61 +1435,65 @@ dependencies = [ [[package]] name = "cpal" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d959d90e938c5493000514b446987c07aed46c668faaa7d34d6c7a67b1a578c" +checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779" dependencies = [ "alsa", "core-foundation-sys", "coreaudio-rs", "dasp_sample", - "jni 0.19.0", + "jni", "js-sys", "libc", "mach2", "ndk", "ndk-context", "oboe", - "once_cell", - "parking_lot", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows 0.46.0", + "windows 0.54.0", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "cursor-icon" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "d3d12" -version = "0.6.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" +checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" dependencies = [ - "bitflags 1.3.2", - "libloading 0.7.4", + "bitflags 2.5.0", + "libloading 0.8.3", "winapi", ] @@ -1330,29 +1503,55 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" +[[package]] +name = "data-encoding" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "dispatch" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading 0.8.3", +] + [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "encase" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6591f13a63571c4821802eb5b10fd1155b1290bce87086440003841c8c3909b" +checksum = "95ed933078d2e659745df651f4c180511cd582e5b9414ff896e7d50d207e3103" dependencies = [ "const_panic", "encase_derive", @@ -1362,22 +1561,22 @@ dependencies = [ [[package]] name = "encase_derive" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1da6deed1f8b6f5909616ffa695f63a5de54d6a0f084fa715c70c8ed3abac9" +checksum = "f4ce1449c7d19eba6cc0abd231150ad81620a8dce29601d7f8d236e5d431d72a" dependencies = [ "encase_derive_impl", ] [[package]] name = "encase_derive_impl" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae489d58959f3c4cdd1250866a05acfb341469affe4fced71aff3ba228be1693" +checksum = "92959a9e8d13eaa13b8ae8c7b583c3bf1669ca7a8e7708a088d12587ba86effc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] @@ -1388,11 +1587,22 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.3.31" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" dependencies = [ "serde", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -1421,6 +1631,17 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + [[package]] name = "event-listener-strategy" version = "0.4.0" @@ -1432,19 +1653,20 @@ dependencies = [ ] [[package]] -name = "fastrand" -version = "1.9.0" +name = "event-listener-strategy" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "instant", + "event-listener 5.3.0", + "pin-project-lite", ] [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fdeflate" @@ -1455,18 +1677,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - [[package]] name = "fixedbitset" version = "0.4.2" @@ -1475,9 +1685,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1491,27 +1701,30 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foreign-types" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ + "foreign-types-macros", "foreign-types-shared", ] [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "foreign-types-macros" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.65", +] [[package]] -name = "fsevent-sys" -version = "4.1.0" +name = "foreign-types-shared" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" -dependencies = [ - "libc", -] +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "futures-core" @@ -1527,46 +1740,32 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "1.13.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 1.9.0", + "fastrand", "futures-core", "futures-io", - "memchr", "parking", "pin-project-lite", - "waker-fn", ] [[package]] -name = "futures-lite" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" -dependencies = [ - "fastrand 2.0.1", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "fxhash" -version = "0.2.1" +name = "gethostname" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ - "byteorder", + "libc", + "windows-targets 0.48.5", ] [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -1577,9 +1776,9 @@ dependencies = [ [[package]] name = "gilrs" -version = "0.10.4" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b2e57a9cb946b5d04ae8638c5f554abb5a9f82c4c950fd5b1fee6d119592fb" +checksum = "b54e5e39844ab5cddaf3bbbdfdc2923a6cb34e36818b95618da4e3f26302c24c" dependencies = [ "fnv", "gilrs-core", @@ -1590,36 +1789,41 @@ dependencies = [ [[package]] name = "gilrs-core" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0af1827b7dd2f36d740ae804c1b3ea0d64c12533fb61ff91883005143a0e8c5a" +checksum = "85c132270a155f2548e67d66e731075c336c39098afc555752f3df8f882c720e" dependencies = [ "core-foundation", - "inotify 0.10.2", + "inotify", "io-kit-sys", "js-sys", "libc", "libudev-sys", "log", - "nix 0.27.1", + "nix", "uuid", "vec_map", "wasm-bindgen", "web-sys", - "windows 0.52.0", + "windows 0.54.0", ] [[package]] -name = "gimli" -version = "0.28.1" +name = "gl_generator" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] [[package]] name = "glam" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e4afd9ad95555081e109fe1d21f2a30c691b5f0919c67dfa690a2e1eb6bd51c" +checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" dependencies = [ "bytemuck", "serde", @@ -1633,9 +1837,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "glow" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" dependencies = [ "js-sys", "slotmap", @@ -1645,9 +1849,9 @@ dependencies = [ [[package]] name = "gltf" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b78f069cf941075835822953c345b9e1edd67ae347b81ace3aea9de38c2ef33" +checksum = "e3ce1918195723ce6ac74e80542c5a96a40c2b26162c1957a5cd70799b8cacf7" dependencies = [ "byteorder", "gltf-json", @@ -1657,21 +1861,21 @@ dependencies = [ [[package]] name = "gltf-derive" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "438ffe1a5540d75403feaf23636b164e816e93f6f03131674722b3886ce32a57" +checksum = "14070e711538afba5d6c807edb74bcb84e5dbb9211a3bf5dea0dfab5b24f4c51" dependencies = [ "inflections", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "gltf-json" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655951ba557f2bc69ea4b0799446bae281fa78efae6319968bdd2c3e9a06d8e1" +checksum = "e6176f9d60a7eab0a877e8e96548605dedbde9190a7ae1e80bbcc1c9af03ab14" dependencies = [ "gltf-derive", "serde", @@ -1679,6 +1883,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator", +] + [[package]] name = "glyph_brush_layout" version = "0.2.3" @@ -1692,34 +1905,34 @@ dependencies = [ [[package]] name = "gpu-alloc" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "gpu-alloc-types", ] [[package]] name = "gpu-alloc-types" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] name = "gpu-allocator" -version = "0.22.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" dependencies = [ - "backtrace", "log", + "presser", "thiserror", "winapi", - "windows 0.44.0", + "windows 0.52.0", ] [[package]] @@ -1728,9 +1941,9 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "gpu-descriptor-types", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -1739,7 +1952,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", ] [[package]] @@ -1760,47 +1973,44 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.7", - "serde", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.7", + "ahash", "allocator-api2", + "serde", ] [[package]] name = "hassle-rs" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90601c6189668c7345fc53842cb3f3a3d872203d523be1b3cb44a36a3e62fb85" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 1.3.2", - "com-rs", + "bitflags 2.5.0", + "com", "libc", - "libloading 0.7.4", + "libloading 0.8.3", "thiserror", "widestring", "winapi", ] +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hexasphere" -version = "8.1.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd41d443f978bfa380a6dad58b62a08c43bcb960631f13e9d015b911eaf73588" +checksum = "f33ddb7f7143d9e703c072e88b98cd8b9719f174137a671429351bd2ee43c02a" dependencies = [ + "constgebra", "glam", - "once_cell", ] [[package]] @@ -1809,11 +2019,22 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" +[[package]] +name = "icrate" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" +dependencies = [ + "block2 0.3.0", + "dispatch", + "objc2 0.4.1", +] + [[package]] name = "image" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" dependencies = [ "bytemuck", "byteorder", @@ -1824,22 +2045,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.2.2" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -1848,17 +2059,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" -[[package]] -name = "inotify" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" -dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", -] - [[package]] name = "inotify" version = "0.10.2" @@ -1879,23 +2079,11 @@ dependencies = [ "libc", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "io-kit-sys" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4769cb30e5dcf1710fc6730d3e94f78c47723a014a567de385e113c737394640" +checksum = "617ee6cf8e3f66f3b4ea67a4058564628cde41901316e19f559e14c7c72c5e7b" dependencies = [ "core-foundation-sys", "mach2", @@ -1912,36 +2100,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - -[[package]] -name = "jni" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", + "cfg-if", "combine", "jni-sys", "log", "thiserror", "walkdir", + "windows-sys 0.45.0", ] [[package]] @@ -1952,52 +2128,38 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "khronos-egl" -version = "4.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.7.4", + "libloading 0.8.3", "pkg-config", ] [[package]] -name = "kqueue" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" -dependencies = [ - "kqueue-sys", - "libc", -] - -[[package]] -name = "kqueue-sys" -version = "1.0.4" +name = "khronos_api" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" -dependencies = [ - "bitflags 1.3.2", - "libc", -] +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "ktx2" @@ -2033,9 +2195,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" @@ -2049,12 +2211,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.5", ] [[package]] @@ -2063,7 +2225,7 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libc", "redox_syscall 0.4.1", ] @@ -2078,11 +2240,17 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2090,9 +2258,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "mach2" @@ -2123,22 +2291,23 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "metal" -version = "0.24.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "block", "core-graphics-types", "foreign-types", "log", "objc", + "paste", ] [[package]] @@ -2149,58 +2318,66 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", "simd-adler32", ] [[package]] -name = "mio" -version = "0.8.10" +name = "naga" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" dependencies = [ - "libc", + "bit-set", + "bitflags 2.5.0", + "codespan-reporting", + "hexf-parse", + "indexmap", "log", - "wasi", - "windows-sys 0.48.0", + "num-traits", + "pp-rs", + "rustc-hash", + "spirv", + "termcolor", + "thiserror", + "unicode-xid", ] [[package]] -name = "naga" -version = "0.11.1" +name = "naga_oil" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c3d4269bcb7d50121097702fde1afb75f4ea8083aeb7a55688dcf289a853271" +checksum = "c0ea62ae0f2787456afca7209ca180522b41f00cbe159ee369eba1e07d365cd1" dependencies = [ "bit-set", - "bitflags 1.3.2", "codespan-reporting", - "hexf-parse", - "indexmap 1.9.3", - "log", - "num-traits", - "petgraph", - "pp-rs", + "data-encoding", + "indexmap", + "naga", + "once_cell", + "regex", + "regex-syntax 0.8.3", "rustc-hash", - "spirv", - "termcolor", "thiserror", - "unicode-xid", + "tracing", + "unicode-ident", ] [[package]] name = "ndk" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "jni-sys", + "log", "ndk-sys", - "num_enum 0.5.11", + "num_enum", "raw-window-handle", "thiserror", ] @@ -2213,32 +2390,22 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-sys" -version = "0.4.1+23.1.7779620" +version = "0.5.0+25.2.9519653" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" dependencies = [ "jni-sys", ] [[package]] name = "nix" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", -] - -[[package]] -name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", + "cfg_aliases", "libc", ] @@ -2253,22 +2420,10 @@ dependencies = [ ] [[package]] -name = "notify" -version = "5.2.0" +name = "nonmax" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729f63e1ca555a43fe3efa4f3efdf4801c479da85b432242a7b726f353c88486" -dependencies = [ - "bitflags 1.3.2", - "crossbeam-channel", - "filetime", - "fsevent-sys", - "inotify 0.9.6", - "kqueue", - "libc", - "mio", - "walkdir", - "windows-sys 0.45.0", -] +checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51" [[package]] name = "ntapi" @@ -2291,64 +2446,43 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.3.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - -[[package]] -name = "num_enum" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" -dependencies = [ - "num_enum_derive 0.6.1", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", + "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.6.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -2367,15 +2501,31 @@ version = "0.2.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" +[[package]] +name = "objc-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da284c198fb9b7b0603f8635185e85fbd5b64ee154b1ed406d489077de2d6d60" + [[package]] name = "objc2" version = "0.3.0-beta.3.patch-leaks.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" dependencies = [ - "block2", - "objc-sys", - "objc2-encode", + "block2 0.2.0-alpha.6", + "objc-sys 0.2.0-beta.2", + "objc2-encode 2.0.0-pre.2", +] + +[[package]] +name = "objc2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" +dependencies = [ + "objc-sys 0.3.3", + "objc2-encode 3.0.0", ] [[package]] @@ -2384,9 +2534,15 @@ version = "2.0.0-pre.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" dependencies = [ - "objc-sys", + "objc-sys 0.2.0-beta.2", ] +[[package]] +name = "objc2-encode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" + [[package]] name = "objc_exception" version = "0.1.2" @@ -2396,22 +2552,13 @@ dependencies = [ "cc", ] -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - [[package]] name = "oboe" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8868cc237ee02e2d9618539a23a8d228b9bb3fc2e7a5b11eed3831de77c395d0" +checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" dependencies = [ - "jni 0.20.0", + "jni", "ndk", "ndk-context", "num-derive", @@ -2421,9 +2568,9 @@ dependencies = [ [[package]] name = "oboe-sys" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f44155e7fb718d3cfddcf70690b2b51ac4412f347cd9e4fbe511abe9cd7b5f2" +checksum = "6c8bb09a4a2b1d668170cfe0a7d5bc103f8999fb316c98099b6a9939c9f2e79d" dependencies = [ "cc", ] @@ -2460,9 +2607,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owned_ttf_parser" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" +checksum = "6b41438d2fc63c46c74a2203bf5ccd82c41ba04347b2fcf5754f230b167067d5" dependencies = [ "ttf-parser", ] @@ -2475,9 +2622,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -2485,22 +2632,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" @@ -2510,31 +2657,42 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.2", + "indexmap", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "piper" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "png" -version = "0.17.11" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -2543,6 +2701,21 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "polling" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "pp-rs" version = "0.2.1" @@ -2552,36 +2725,41 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "once_cell", "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0f7f43585c34e4fdd7497d746bc32e14458cf11c69341cc0587b1d825dde42" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2600,9 +2778,9 @@ checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" [[package]] name = "raw-window-handle" -version = "0.5.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "rectangle-pack" @@ -2628,16 +2806,25 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -2651,13 +2838,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -2668,15 +2855,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "renderdoc-sys" -version = "0.7.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "rodio" @@ -2694,39 +2881,47 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ - "base64 0.21.7", - "bitflags 2.4.2", + "base64", + "bitflags 2.5.0", "serde", "serde_derive", ] -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - [[package]] name = "rustc-hash" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "ruzstd" -version = "0.2.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cada0ef59efa6a5f4dc5e491f93d9f31e3fc7758df421ff1de8a706338e1100" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" dependencies = [ "byteorder", + "derive_more", "twox-hash", ] [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2745,29 +2940,29 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -2815,21 +3010,29 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] + +[[package]] +name = "smol_str" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" dependencies = [ "serde", ] [[package]] name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 1.3.2", - "num-traits", + "bitflags 2.5.0", ] [[package]] @@ -2840,9 +3043,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "svg_fmt" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" +checksum = "20e16a0f46cf5fd675563ef54f26e83e20f2366bcf027bcb3cc3ed2b98aaf2ca" [[package]] name = "syn" @@ -2857,9 +3060,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" dependencies = [ "proc-macro2", "quote", @@ -2868,23 +3071,23 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.28.4" +version = "0.30.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b" +checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae" dependencies = [ "cfg-if", "core-foundation-sys", "libc", "ntapi", "once_cell", - "winapi", + "windows 0.52.0", ] [[package]] name = "taffy" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2287b6d7f721ada4cddf61ade5e760b2c6207df041cac9bfaa192897362fd3" +checksum = "b1315457ccd9c3def787a18fae91914e623e4dcff019b64ce39f5268ded53d3d" dependencies = [ "arrayvec", "grid", @@ -2903,29 +3106,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2948,17 +3151,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.2", + "indexmap", "toml_datetime", "winnow", ] @@ -2982,7 +3185,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -3048,9 +3251,9 @@ dependencies = [ [[package]] name = "ttf-parser" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" [[package]] name = "twox-hash" @@ -3062,17 +3265,29 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "typeid" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode-xid" @@ -3082,9 +3297,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", "serde", @@ -3108,17 +3323,11 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -3132,9 +3341,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3142,24 +3351,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -3169,9 +3378,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3179,39 +3388,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] -name = "wayland-scanner" -version = "0.29.5" +name = "web-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ - "proc-macro2", - "quote", - "xml-rs", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "web-sys" -version = "0.3.68" +name = "web-time" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" dependencies = [ "js-sys", "wasm-bindgen", @@ -3219,12 +3427,13 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.15.1" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d745a1b6d91d85c33defbb29f0eee0450e1d2614d987e14bf6baf26009d132d7" +checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01" dependencies = [ "arrayvec", "cfg-if", + "cfg_aliases", "js-sys", "log", "naga", @@ -3243,20 +3452,23 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.15.1" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131408d940e335792645a98f03639573b0480e9e2e7cddbbab74f7c6d9f3fff" +checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a" dependencies = [ "arrayvec", "bit-vec", - "bitflags 1.3.2", + "bitflags 2.5.0", + "cfg_aliases", "codespan-reporting", - "fxhash", + "indexmap", "log", "naga", + "once_cell", "parking_lot", "profiling", "raw-window-handle", + "rustc-hash", "smallvec", "thiserror", "web-sys", @@ -3266,21 +3478,21 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.15.4" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdcf61a283adc744bb5453dd88ea91f3f86d5ca6b027661c6c73c7734ae0288b" +checksum = "fc1a4924366df7ab41a5d8546d6534f1f33231aa5b3f72b9930e300f254e39c3" dependencies = [ "android_system_properties", "arrayvec", "ash", "bit-set", - "bitflags 1.3.2", + "bitflags 2.5.0", "block", + "cfg_aliases", "core-graphics-types", "d3d12", - "foreign-types", - "fxhash", "glow", + "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -3288,16 +3500,19 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.7.4", + "libloading 0.8.3", "log", "metal", "naga", + "ndk-sys", "objc", + "once_cell", "parking_lot", "profiling", "range-alloc", "raw-window-handle", "renderdoc-sys", + "rustc-hash", "smallvec", "thiserror", "wasm-bindgen", @@ -3308,20 +3523,20 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.15.2" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32444e121b0bd00cb02c0de32fde457a9491bd44e03e7a5db6df9b1da2f6f110" +checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "js-sys", "web-sys", ] [[package]] name = "widestring" -version = "0.5.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -3341,11 +3556,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -3356,32 +3571,33 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ "windows-implement", "windows-interface", - "windows-targets 0.42.2", + "windows-targets 0.48.5", ] [[package]] name = "windows" -version = "0.46.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets 0.42.2", + "windows-core 0.52.0", + "windows-targets 0.52.5", ] [[package]] name = "windows" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core", - "windows-targets 0.52.0", + "windows-core 0.54.0", + "windows-targets 0.52.5", ] [[package]] @@ -3390,14 +3606,24 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.5", ] [[package]] name = "windows-implement" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6" +checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c" dependencies = [ "proc-macro2", "quote", @@ -3406,15 +3632,24 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f" +checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "windows-result" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" +dependencies = [ + "windows-targets 0.52.5", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -3439,7 +3674,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -3474,17 +3709,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -3501,9 +3737,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -3519,9 +3755,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -3537,9 +3773,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -3555,9 +3797,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -3573,9 +3815,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -3591,9 +3833,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -3609,45 +3851,55 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winit" -version = "0.28.7" +version = "0.29.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" +checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" dependencies = [ "android-activity", - "bitflags 1.3.2", + "atomic-waker", + "bitflags 2.5.0", + "bytemuck", + "calloop", "cfg_aliases", "core-foundation", "core-graphics", - "dispatch", - "instant", + "cursor-icon", + "icrate", + "js-sys", "libc", "log", - "mio", "ndk", - "objc2", + "ndk-sys", + "objc2 0.4.1", "once_cell", "orbclient", "percent-encoding", "raw-window-handle", "redox_syscall 0.3.5", + "rustix", + "smol_str", + "unicode-segmentation", "wasm-bindgen", - "wayland-scanner", + "wasm-bindgen-futures", "web-sys", - "windows-sys 0.45.0", + "web-time", + "windows-sys 0.48.0", "x11-dl", + "x11rb", + "xkbcommon-dl", ] [[package]] name = "winnow" -version = "0.5.39" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -3663,34 +3915,74 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading 0.8.3", + "once_cell", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + [[package]] name = "xi-unicode" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.5.0", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" + [[package]] name = "xml-rs" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" +checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] diff --git a/crates/argus_cli/tests/workspaces/bevy/Cargo.toml b/crates/argus_cli/tests/workspaces/bevy/Cargo.toml index 71b6048..11fed6a 100644 --- a/crates/argus_cli/tests/workspaces/bevy/Cargo.toml +++ b/crates/argus_cli/tests/workspaces/bevy/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = "0.10.1" +bevy = "0.13" diff --git a/crates/argus_cli/tests/workspaces/bevy/src/main.rs b/crates/argus_cli/tests/workspaces/bevy/src/main.rs index aa32563..8472dc3 100644 --- a/crates/argus_cli/tests/workspaces/bevy/src/main.rs +++ b/crates/argus_cli/tests/workspaces/bevy/src/main.rs @@ -6,5 +6,5 @@ struct Timer(usize); fn startup_system(_: Timer) {} fn main() { - App::new().add_startup_system(startup_system).run(); + App::new().add_systems(Startup, startup_system).run(); } diff --git a/ide/packages/common/src/lib.ts b/ide/packages/common/src/lib.ts index 90ec146..a2a1dd3 100644 --- a/ide/packages/common/src/lib.ts +++ b/ide/packages/common/src/lib.ts @@ -27,8 +27,7 @@ export const ConfigConsts = { // ---------------------------------------------------- // Panoptes initial configuration for a single webview -export type PanoptesInitialData = { - data: [Filename, ObligationsInBody[]][]; +export type PanoptesOptionalData = { target?: ErrorJumpTargetInfo; evalMode?: EvaluationMode; }; @@ -36,11 +35,12 @@ export type PanoptesInitialData = { export type SystemSpec = Omit; export type EvaluationMode = "release" | "rank" | "random"; -export type PanoptesConfig = PanoptesInitialData & +export type PanoptesConfig = PanoptesOptionalData & ( | { type: "VSCODE_BACKING"; spec: SystemSpec; + data: [Filename, ObligationsInBody[]][]; } | { type: "WEB_BUNDLE"; @@ -92,28 +92,25 @@ export type PayloadTypes = { }; export type SystemToPanoptesCmds = - | "reset" + | "havoc" | "open-file" | "open-error" - | "obligations" | "tree"; export type SystemToPanoptesMsg = { command: T; type: FROM_EXT; -} & (T extends "reset" - ? { data: [Filename, ObligationsInBody[]][] } +} & (T extends "havoc" + ? {} : CommonData & (T extends "open-file" - ? { data: ObligationsInBody[] } + ? { data: ObligationsInBody[]; signature: string } : T extends "open-error" ? { bodyIdx: BodyHash; exprIdx: ExprIdx; hash: ObligationHash; } - : T extends "obligations" - ? { obligations: ObligationsInBody[] } : T extends "tree" ? { tree?: SerializedTree } : never)); @@ -180,52 +177,52 @@ export type CallArgus = ( // Type predicates (these shouldn't really exist ...) -export function isSysMsg( - obj: any -): obj is SystemToPanoptesMsg { - return typeof obj === "object" && "command" in obj; +function objWCmd(m: any): m is { command: string } { + return typeof m === "object" && "command" in m; } export function isSysMsgOpenError( - msg: SystemToPanoptesMsg + msg: unknown ): msg is SystemToPanoptesMsg<"open-error"> { - return msg.command === "open-error"; + return objWCmd(msg) && msg.command === "open-error"; } export function isSysMsgOpenFile( - msg: SystemToPanoptesMsg + msg: unknown ): msg is SystemToPanoptesMsg<"open-file"> { - return msg.command === "open-file"; + return objWCmd(msg) && msg.command === "open-file"; } -export function isSysMsgReset( - msg: SystemToPanoptesMsg -): msg is SystemToPanoptesMsg<"reset"> { - return msg.command === "reset"; +export function isSysMsgHavoc( + msg: unknown +): msg is SystemToPanoptesMsg<"havoc"> { + return objWCmd(msg) && msg.command === "havoc"; } -export function isPanoMsgTree( - msg: PanoptesToSystemMsg -): msg is PanoptesToSystemMsg<"tree"> { - return msg.command === "tree"; -} +// ------------------------------------------------------ export function isPanoMsgObligations( - msg: PanoptesToSystemMsg + msg: unknown ): msg is PanoptesToSystemMsg<"obligations"> { - return msg.command === "obligations"; + return objWCmd(msg) && msg.command === "obligations"; +} + +export function isPanoMsgTree( + msg: unknown +): msg is PanoptesToSystemMsg<"tree"> { + return objWCmd(msg) && msg.command === "tree"; } export function isPanoMsgAddHighlight( - msg: PanoptesToSystemMsg + msg: unknown ): msg is PanoptesToSystemMsg<"add-highlight"> { - return msg.command === "add-highlight"; + return objWCmd(msg) && msg.command === "add-highlight"; } export function isPanoMsgRemoveHighlight( - msg: PanoptesToSystemMsg + msg: unknown ): msg is PanoptesToSystemMsg<"remove-highlight"> { - return msg.command === "remove-highlight"; + return objWCmd(msg) && msg.command === "remove-highlight"; } export interface IssueOptions { diff --git a/ide/packages/evaluation/src/basic.ts b/ide/packages/evaluation/src/basic.ts new file mode 100644 index 0000000..9fe2260 --- /dev/null +++ b/ide/packages/evaluation/src/basic.ts @@ -0,0 +1,89 @@ +import _ from "lodash"; +import path from "path"; +import { chromium } from "playwright"; + +import { RootCause } from "./rootCauses"; +import { + argusData, + expandBottomUpView, + forFileInBundle, + openPage, + sleep, + testCases, +} from "./utils"; + +interface ReturnType { + workspace: string; + filename: string; + cause: string; + numberTreeNodes?: number; + rank?: number; +} + +async function createWorkspaceRunner() { + // Shared state among all runs + const workspaceDir = path.resolve(__dirname, "..", "workspaces"); + const browser = await chromium.launch({ headless: !global.debugging }); + const context = await browser.newContext(); + + return async ({ workspace, causes }: RootCause) => { + const fullSubdir = path.resolve(workspaceDir, workspace); + const argusBundles = await argusData(fullSubdir); + + if (!("Ok" in argusBundles)) throw new Error("Argus failed"); + return forFileInBundle(argusBundles.Ok, async (filename, bundles) => { + const cause = _.find(causes, cause => filename.endsWith(cause.file)) as + | { file: string; message: string } + | undefined; + + if (!cause) return; + const page = await openPage(context, filename, bundles, "rank"); + + await sleep(5000); + await expandBottomUpView(page); + await sleep(5000); + + const goals = await page + .locator(".BottomUpArea .EvalGoal") + .filter({ hasText: cause.message }) + .all(); + + console.debug(`Found ${filename}:${goals.length} goals ${cause.message}`); + + const ranksStr = await Promise.all( + _.map(goals, goal => goal.getAttribute("data-rank")) + ); + const rank = _.min(_.map(_.compact(ranksStr), r => Number(r))); + + const numberTreeNodes = _.max( + _.flatten( + _.map(bundles, bundle => + _.map(_.values(bundle.trees), tree => tree.nodes.length) + ) + ) + ); + + await page.close(); + return { + workspace, + filename, + cause: cause.message, + numberTreeNodes, + rank, + }; + }); + }; +} + +export async function run(rootCauses: RootCause[]) { + const runForWorkspace = await createWorkspaceRunner(); + + const tcs = testCases(); + const filteredCauses = _.filter(rootCauses, ({ workspace }) => + _.includes(tcs, workspace) + ); + + const results = await Promise.all(_.map(filteredCauses, runForWorkspace)); + const flatResults = _.flatten(results); + return _.filter(_.compact(flatResults), v => v.rank !== undefined); +} diff --git a/ide/packages/evaluation/src/main.ts b/ide/packages/evaluation/src/main.ts index 90c8cb5..7b9ba8d 100644 --- a/ide/packages/evaluation/src/main.ts +++ b/ide/packages/evaluation/src/main.ts @@ -1,381 +1,51 @@ -import { BodyBundle } from "@argus/common/bindings"; -import { EvaluationMode, Filename, Result } from "@argus/common/lib"; -import { ExecNotifyOpts, execNotify as _execNotify } from "@argus/system"; -import fs from "fs"; import _ from "lodash"; -import path from "path"; -import { - BrowserContext, - ElementHandle, - Page, - chromium, - selectors, -} from "playwright"; -import tmp from "tmp"; -//@ts-ignore -import uniqueFilename from "unique-filename"; -import { webHtml } from "./page"; -import { rootCauses } from "./rootCauses"; -import { PORT, fileServer } from "./serve"; +import { run as runBasic } from "./basic"; +import { run as runRandom } from "./random"; +import { rootCauses as TEST_CAUSES } from "./rootCauses"; +import { PORT, withServerOnPort } from "./serve"; +import { run as runVisual } from "./visual"; declare global { var debugging: boolean; + var testMatcher: string; } -// See: https://doc.rust-lang.org/cargo/reference/external-tools.html -// https://doc.rust-lang.org/rustc/json.html -// for up-to-date information on the structure of diagnostics output. -interface DiagnosticMessage { - reason: "compiler-message"; - target: { - src_path: string; - }; - message: { - rendered: string; - message: string; - spans: { file_name: string; is_primary: boolean }[]; - }; -} - -function isRustcMessage(obj: any): obj is DiagnosticMessage { - return obj.reason === "compiler-message"; -} - -function diagnosticFilename(msg: DiagnosticMessage) { - const mainMsg = _.find(msg.message.spans, span => span.is_primary); - return mainMsg ? mainMsg.file_name : msg.target.src_path; -} - -// TODO: move the "title" from execNotify into the opts, and use the `cmd` if not present. -const execSilent = (cmd: string, args: string[], opts: ExecNotifyOpts) => { - return _execNotify(cmd, args, opts, (..._args: any[]) => {}); -}; - -async function sleep(waitTime: number) { - return new Promise(resolve => setTimeout(resolve, waitTime)); -} - -async function forFileInBundle( - bundles: BodyBundle[], - f: (filename: Filename, bundles: BodyBundle[]) => Promise -) { - const groupedByFilename = _.groupBy(bundles, b => b.filename); - return await Promise.all( - _.map(groupedByFilename, async (bundles, filename) => { - return f(filename, bundles); - }) - ); -} - -async function openPage( - context: BrowserContext, - filename: string, - bundles: BodyBundle[], - evalMode: EvaluationMode -) { - const tmpobj = tmp.fileSync({ postfix: ".html" }); - const html = webHtml("EVAL", filename, bundles, evalMode); - fs.writeSync(tmpobj.fd, html); - const page = await context.newPage(); - await page.goto(`file://${tmpobj.name}`, { - waitUntil: "domcontentloaded", - timeout: 30_000, - }); - return page; -} - -async function expandBottomUpView(page: Page) { - let bs = await page.getByText("Bottom Up").all(); - try { - // await Promise.all( - // _.map(bs, async b => { - // try { - // await b.waitFor({ state: "visible" }); - // } catch (e: any) {} - // }) - // ); - await Promise.all( - _.map(bs, async b => { - try { - await b.click(); - } catch (e: any) {} - }) - ); - } catch (e: any) { - console.debug("Error clicking bottom up", e); - } -} - -// Take bundled argus output and take a screenshot of the tree loaded into the browser. -async function argusScreenshots( - outDir: fs.PathLike, - bundles: BodyBundle[], - title: string = "Argus Output" -) { - const browser = await chromium.launch({ headless: !global.debugging }); - const context = await browser.newContext(); - - const innerDoScreenshot = async ( - out: string, - filename: Filename, - bundles: BodyBundle[] - ) => { - const page = await openPage(context, filename, bundles, "rank"); - await expandBottomUpView(page); - await page.screenshot({ path: out, fullPage: true }); - }; - - return forFileInBundle(bundles, async (filename, bundles) => { - const outfile = uniqueFilename(outDir) + ".png"; - await innerDoScreenshot(outfile, filename, bundles); - return { filename, outfile }; - }); -} - -async function argusData(dir: string) { - const argusOutput = await execSilent("cargo", ["argus", "bundle"], { - cwd: dir, - }); - const bundles: Result = JSON.parse(argusOutput); - return bundles; -} - -async function cargoMessages(dir: string) { - const cargoOutput = await execSilent( - "cargo", - ["check", "--message-format", "json"], - { cwd: dir, ignoreExitCode: true } - ); - const cargoOutputLns = cargoOutput.split("\n"); - const output = _.map(cargoOutputLns, JSON.parse); - const rustcMessages = _.filter(output, isRustcMessage); - return _.groupBy(rustcMessages, msg => diagnosticFilename(msg)); -} - -function ensureDir(dir: fs.PathLike) { - if (!fs.existsSync(dir)) { - fs.mkdirSync(dir, { recursive: true }); - } -} - -// When chumsky is working just read the directory contents -const testCases = [ - "axum", - "bevy", - "diesel", - "easy_ml", - "entrait", - "nalgebra", - "uom", -] as const; - async function runForJson(func: () => Promise) { return JSON.stringify(JSON.stringify(await func())); } -async function runRandom(N: number) { - fileServer().listen(PORT); - const workspaceDir = path.resolve(__dirname, "..", "workspaces"); - const browser = await chromium.launch({ headless: !global.debugging }); - const context = await browser.newContext(); - context.setDefaultTimeout(5_000); - - const innerF = async (workspace: string, causes: any[]) => { - const fullSubdir = path.resolve(workspaceDir, workspace); - const argusBundles = await argusData(fullSubdir); - - if (!("Ok" in argusBundles)) throw new Error("Argus failed"); - const fileBundles = (await forFileInBundle( - argusBundles.Ok, - async (filename, bundles) => [filename, bundles] - )) as [string, BodyBundle[]][]; - - let results = []; - for (const [filename, bundles] of fileBundles) { - const cause = _.find(causes, cause => filename.endsWith(cause.file)); - - if (!cause) { - console.error(`No cause found for ${filename} in ${workspace}`); - continue; - } - console.debug(`Running ${N} samples for ${filename}`); - let ranks = await Promise.all( - _.times(N, async () => { - const page = await openPage(context, filename, bundles, "random"); - await sleep(3000); - await expandBottomUpView(page); - await sleep(3000); - try { - const goals = await page - .locator(".BottomUpArea .EvalGoal") - .filter({ hasText: cause.message }) - .all(); - - const ranksStr = await Promise.all( - _.map(goals, goal => goal.getAttribute("data-rank")) - ); - - return _.min(_.map(_.compact(ranksStr), r => Number(r))); - } catch (e) { - return undefined; - } finally { - await page.close(); - } - }) - ); - - const noUndef = _.compact(ranks); - if (noUndef.length === 0) { - console.error(`No ranks found for ${filename} in ${workspace}`); - } - - results.push({ - workspace, - filename, - cause: cause.message, - ranks: noUndef, - }); - } - - return results; - }; - - let results = []; - for (const { workspace, causes } of rootCauses) { - results.push(await innerF(workspace, causes)); - } - - return _.flatten(results); -} - -async function runEvaluation() { - fileServer().listen(PORT); - const workspaceDir = path.resolve(__dirname, "..", "workspaces"); - const browser = await chromium.launch({ headless: !global.debugging }); - const context = await browser.newContext(); - const results = await Promise.all( - _.map(rootCauses, async ({ workspace, causes }) => { - const fullSubdir = path.resolve(workspaceDir, workspace); - const argusBundles = await argusData(fullSubdir); - - if (!("Ok" in argusBundles)) throw new Error("Argus failed"); - return forFileInBundle(argusBundles.Ok, async (filename, bundles) => { - const cause = _.find(causes, cause => filename.endsWith(cause.file)) as - | { file: string; message: string } - | undefined; - - if (!cause) return; - const page = await openPage(context, filename, bundles, "rank"); - - await sleep(5000); - await expandBottomUpView(page); - await sleep(5000); - - const goals = await page - .locator(".BottomUpArea .EvalGoal") - .filter({ hasText: cause.message }) - .all(); - - console.debug( - `Found ${filename}:${goals.length} goals ${cause.message}` - ); - - const ranksStr = await Promise.all( - _.map(goals, goal => goal.getAttribute("data-rank")) - ); - const rank = _.min(_.map(_.compact(ranksStr), r => Number(r))); - - const numberTreeNodes = _.max( - _.flatten( - _.map(bundles, bundle => - _.map(_.values(bundle.trees), tree => tree.nodes.length) - ) - ) - ); - - await page.close(); - return { - workspace, - filename, - cause: cause.message, - numberTreeNodes, - rank, - }; - }); - }) - ); - - return _.filter(_.compact(_.flatten(results)), v => v.rank !== undefined); -} - -async function outputInDir(resultsDir: string) { - fileServer().listen(PORT); - ensureDir(resultsDir); - - const workspaceDir = path.resolve(__dirname, "..", "workspaces"); - - const doForSubdir = async (outdir: string, subdir: string) => { - const fullSubdir = path.resolve(workspaceDir, subdir); - const outDir = path.resolve(outdir, subdir); - ensureDir(outDir); - - const [rustcMessages, argusBundles] = await Promise.all([ - cargoMessages(fullSubdir), - argusData(fullSubdir), - ]); - - const result = - "Ok" in argusBundles - ? await (async () => { - const screenshots = await argusScreenshots( - outDir, - argusBundles.Ok, - subdir - ); - return _.map(screenshots, ({ filename, outfile }) => { - const diagnostics = - _.find(rustcMessages, (_msgs, src) => { - return src.endsWith(filename) || filename.endsWith(src); - }) ?? []; - return { filename, argusScreenshotFn: outfile, diagnostics }; - }); - })() - : argusBundles; - - return { test: subdir, result }; - }; - - return await Promise.all( - _.map(testCases, subdir => doForSubdir(resultsDir, subdir)) - ); -} - -async function runScreenshots(cacheDirectory: string) { - const results = await outputInDir(cacheDirectory); - const mapFile = path.resolve(cacheDirectory, "results-map.json"); - fs.writeFileSync(mapFile, JSON.stringify(results)); -} - async function main() { global.debugging = _.includes(process.argv, "--debug"); - const argv = _.filter(process.argv, arg => arg !== "--debug"); + const hasTestMatcher = _.find(process.argv, arg => arg.startsWith("--test=")); + global.testMatcher = hasTestMatcher + ? hasTestMatcher.split("=")[1] + : "[\\s\\S]*"; + + const argv = _.filter( + process.argv, + arg => arg !== "--debug" && !arg.startsWith("--test") + ); switch (argv[2]) { case "-r": { const N = Number(argv[3] ?? "10"); - await runForJson(() => runRandom(N)).then(console.log); + await withServerOnPort(PORT, () => + runForJson(() => runRandom(N, TEST_CAUSES)) + ).then(console.log); break; } case "-h": { - await runForJson(() => runEvaluation()).then(console.log); + await withServerOnPort(PORT, () => + runForJson(() => runBasic(TEST_CAUSES)) + ).then(console.log); break; } case "-s": { const cacheDirectory = argv[3]; if (cacheDirectory === undefined) throw new Error("Must provide a cache directory"); - await runScreenshots(cacheDirectory); + await withServerOnPort(PORT, () => runVisual(cacheDirectory)); } default: throw new Error("Invalid CLI argument"); diff --git a/ide/packages/evaluation/src/page.ts b/ide/packages/evaluation/src/page.ts index 3fbe680..ffc0c5d 100644 --- a/ide/packages/evaluation/src/page.ts +++ b/ide/packages/evaluation/src/page.ts @@ -746,7 +746,6 @@ export function webHtml( const config: PanoptesConfig = { type: "WEB_BUNDLE", target: findErrorTargetInBundles(bundles), - data: [[filename, bundles.map(b => b.body)]], closedSystem: bundles, evalMode, }; diff --git a/ide/packages/evaluation/src/random.ts b/ide/packages/evaluation/src/random.ts new file mode 100644 index 0000000..6483bf2 --- /dev/null +++ b/ide/packages/evaluation/src/random.ts @@ -0,0 +1,96 @@ +import { BodyBundle } from "@argus/common/bindings"; +import { execNotify as _execNotify } from "@argus/system"; +import _ from "lodash"; +import path from "path"; +import { chromium } from "playwright"; + +import { RootCause } from "./rootCauses"; +import { + argusData, + expandBottomUpView, + forFileInBundle, + openPage, + sleep, + testCases, +} from "./utils"; + +async function createInnerRun(N: number) { + const workspaceDir = path.resolve(__dirname, "..", "workspaces"); + const browser = await chromium.launch({ headless: !global.debugging }); + const context = await browser.newContext(); + context.setDefaultTimeout(5_000); + + return async (workspace: string, causes: any[]) => { + const fullSubdir = path.resolve(workspaceDir, workspace); + const argusBundles = await argusData(fullSubdir); + + if (!("Ok" in argusBundles)) throw new Error("Argus failed"); + const fileBundles = (await forFileInBundle( + argusBundles.Ok, + async (filename, bundles) => [filename, bundles] + )) as [string, BodyBundle[]][]; + + let results = []; + for (const [filename, bundles] of fileBundles) { + const cause = _.find(causes, cause => filename.endsWith(cause.file)); + + if (!cause) { + console.error(`No cause found for ${filename} in ${workspace}`); + continue; + } + + console.debug(`Running ${N} samples for ${filename}`); + let ranks = await Promise.all( + _.times(N, async () => { + const page = await openPage(context, filename, bundles, "random"); + await sleep(3000); + await expandBottomUpView(page); + await sleep(3000); + try { + const goals = await page + .locator(".BottomUpArea .EvalGoal") + .filter({ hasText: cause.message }) + .all(); + + const ranksStr = await Promise.all( + _.map(goals, goal => goal.getAttribute("data-rank")) + ); + + return _.min(_.map(_.compact(ranksStr), r => Number(r))); + } catch (e) { + return undefined; + } finally { + await page.close(); + } + }) + ); + + const noUndef = _.compact(ranks); + if (noUndef.length === 0) { + console.error(`No ranks found for ${filename} in ${workspace}`); + } + + results.push({ + workspace, + filename, + cause: cause.message, + ranks: noUndef, + }); + } + + return results; + }; +} + +export async function run(N: number, rootCauses: RootCause[]) { + const innerF = await createInnerRun(N); + const tcs = testCases(); + + let results = []; + for (const { workspace, causes } of rootCauses) { + if (!_.includes(tcs, workspace)) continue; + results.push(await innerF(workspace, causes)); + } + + return _.flatten(results); +} diff --git a/ide/packages/evaluation/src/rootCauses.ts b/ide/packages/evaluation/src/rootCauses.ts index 29ea31a..6a52ea2 100644 --- a/ide/packages/evaluation/src/rootCauses.ts +++ b/ide/packages/evaluation/src/rootCauses.ts @@ -1,14 +1,14 @@ export interface RootCause { workspace: string; - causes: [ - { - file: string; - message: string; - } - ]; + causes: FileCause[]; } -export const rootCauses = [ +interface FileCause { + file: string; + message: string; +} + +export const rootCauses: RootCause[] = [ { workspace: "diesel", causes: [ diff --git a/ide/packages/evaluation/src/serve.ts b/ide/packages/evaluation/src/serve.ts index 44fbc8e..a4db2cc 100644 --- a/ide/packages/evaluation/src/serve.ts +++ b/ide/packages/evaluation/src/serve.ts @@ -4,7 +4,21 @@ import url from "url"; export const PORT = 8080; -export function fileServer() { +export async function withServerOnPort( + port: number, + callback: () => Promise +) { + const serve = fileServer(); + try { + serve.listen(port); + return await callback(); + } finally { + serve.closeAllConnections(); + serve.close(); + } +} + +function fileServer() { return http.createServer((request, response) => { response.setHeader("Access-Control-Allow-Origin", "*"); response.setHeader("Access-Control-Request-Method", "*"); diff --git a/ide/packages/evaluation/src/utils.ts b/ide/packages/evaluation/src/utils.ts new file mode 100644 index 0000000..b39b1a2 --- /dev/null +++ b/ide/packages/evaluation/src/utils.ts @@ -0,0 +1,113 @@ +import { BodyBundle } from "@argus/common/bindings"; +import { EvaluationMode, Filename, Result } from "@argus/common/lib"; +import { ExecNotifyOpts, execNotify as _execNotify } from "@argus/system"; +import fs from "fs"; +import _ from "lodash"; +import { BrowserContext, Page } from "playwright"; +import tmp from "tmp"; + +import { webHtml } from "./page"; + +export async function argusData(dir: string) { + const argusOutput = await execSilent("cargo", ["argus", "bundle"], { + cwd: dir, + }); + const bundles: Result = JSON.parse(argusOutput); + return bundles; +} + +// TODO: move the "title" from execNotify into the opts, and use the `cmd` if not present. +export const execSilent = ( + cmd: string, + args: string[], + opts: ExecNotifyOpts +) => { + return _execNotify(cmd, args, opts, (..._args: any[]) => {}); +}; + +export async function sleep(waitTime: number) { + return new Promise(resolve => setTimeout(resolve, waitTime)); +} + +export function testCases() { + // When chumsky is working just read the directory contents + const _testCases = [ + "axum", + "bevy", + "diesel", + "easy_ml", + "entrait", + "nalgebra", + "uom", + ] as const; + + return _testCases.filter(test => test.match(global.testMatcher)); +} + +// See: https://doc.rust-lang.org/cargo/reference/external-tools.html +// https://doc.rust-lang.org/rustc/json.html +// for up-to-date information on the structure of diagnostics output. +export interface DiagnosticMessage { + reason: "compiler-message"; + target: { + src_path: string; + }; + message: { + rendered: string; + message: string; + spans: { file_name: string; is_primary: boolean }[]; + }; +} + +export function diagnosticFilename(msg: DiagnosticMessage) { + const mainMsg = _.find(msg.message.spans, span => span.is_primary); + return mainMsg ? mainMsg.file_name : msg.target.src_path; +} + +export function isRustcMessage(obj: any): obj is DiagnosticMessage { + return obj.reason === "compiler-message"; +} + +export async function expandBottomUpView(page: Page) { + let bs = await page.getByText("Bottom Up").all(); + try { + await Promise.all( + _.map(bs, async b => { + try { + await b.click(); + } catch (e: any) {} + }) + ); + } catch (e: any) { + console.debug("Error clicking bottom up", e); + } +} + +export async function forFileInBundle( + bundles: BodyBundle[], + f: (filename: Filename, bundles: BodyBundle[]) => Promise +) { + const groupedByFilename = _.groupBy(bundles, b => b.filename); + return await Promise.all( + _.map(groupedByFilename, async (bundles, filename) => { + return f(filename, bundles); + }) + ); +} + +export async function openPage( + context: BrowserContext, + filename: string, + bundles: BodyBundle[], + evalMode: EvaluationMode +) { + const tmpobj = tmp.fileSync({ postfix: ".html" }); + const html = webHtml("EVAL", filename, bundles, evalMode); + fs.writeSync(tmpobj.fd, html); + const page = await context.newPage(); + await page.goto(`file://${tmpobj.name}`, { + waitUntil: "domcontentloaded", + timeout: 30_000, + }); + return page; +} diff --git a/ide/packages/evaluation/src/visual.ts b/ide/packages/evaluation/src/visual.ts new file mode 100644 index 0000000..5bed494 --- /dev/null +++ b/ide/packages/evaluation/src/visual.ts @@ -0,0 +1,111 @@ +import { BodyBundle } from "@argus/common/bindings"; +import { Filename } from "@argus/common/lib"; +import { execNotify as _execNotify } from "@argus/system"; +import fs from "fs"; +import _ from "lodash"; +import path from "path"; +import { chromium } from "playwright"; +//@ts-ignore +import uniqueFilename from "unique-filename"; + +import { + argusData, + diagnosticFilename, + execSilent, + expandBottomUpView, + forFileInBundle, + isRustcMessage, + openPage, + testCases, +} from "./utils"; + +function ensureDir(dir: fs.PathLike) { + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } +} + +// Take bundled argus output and take a screenshot of the tree loaded into the browser. +async function argusScreenshots( + outDir: fs.PathLike, + bundles: BodyBundle[], + title: string = "Argus Output" +) { + const browser = await chromium.launch({ headless: !global.debugging }); + const context = await browser.newContext(); + + const innerDoScreenshot = async ( + out: string, + filename: Filename, + bundles: BodyBundle[] + ) => { + const page = await openPage(context, filename, bundles, "rank"); + await expandBottomUpView(page); + await page.screenshot({ path: out, fullPage: true }); + }; + + return forFileInBundle(bundles, async (filename, bundles) => { + const outfile = uniqueFilename(outDir) + ".png"; + await innerDoScreenshot(outfile, filename, bundles); + return { filename, outfile }; + }); +} + +export async function run(cacheDirectory: string) { + const results = await outputInDir(cacheDirectory); + const mapFile = path.resolve(cacheDirectory, "results-map.json"); + fs.writeFileSync(mapFile, JSON.stringify(results)); +} + +async function outputInDir(resultsDir: string) { + ensureDir(resultsDir); + + const workspaceDir = path.resolve(__dirname, "..", "workspaces"); + + const doForSubdir = async (outdir: string, subdir: string) => { + const fullSubdir = path.resolve(workspaceDir, subdir); + const outDir = path.resolve(outdir, subdir); + ensureDir(outDir); + + const [rustcMessages, argusBundles] = await Promise.all([ + cargoMessages(fullSubdir), + argusData(fullSubdir), + ]); + + const result = + "Ok" in argusBundles + ? await (async () => { + const screenshots = await argusScreenshots( + outDir, + argusBundles.Ok, + subdir + ); + return _.map(screenshots, ({ filename, outfile }) => { + const diagnostics = + _.find(rustcMessages, (_msgs, src) => { + return src.endsWith(filename) || filename.endsWith(src); + }) ?? []; + return { filename, argusScreenshotFn: outfile, diagnostics }; + }); + })() + : argusBundles; + + return { test: subdir, result }; + }; + + return await Promise.all( + _.map(testCases(), subdir => doForSubdir(resultsDir, subdir)) + ); +} + +async function cargoMessages(dir: string) { + const cargoOutput = await execSilent( + "cargo", + ["check", "--message-format", "json"], + { cwd: dir, ignoreExitCode: true } + ); + const cargoOutputLns = cargoOutput.split("\n"); + const output = _.map(cargoOutputLns, JSON.parse); + const rustcMessages = _.filter(output, isRustcMessage); + return _.groupBy(rustcMessages, msg => diagnosticFilename(msg)); +} diff --git a/ide/packages/extension/src/ctx.ts b/ide/packages/extension/src/ctx.ts index 2106429..3e41753 100644 --- a/ide/packages/extension/src/ctx.ts +++ b/ide/packages/extension/src/ctx.ts @@ -20,6 +20,7 @@ import { isDocumentInWorkspace, isRustDocument, isRustEditor, + makeid, rustRangeToVscodeRange, } from "./utils"; import { View } from "./view"; @@ -27,6 +28,8 @@ import { View } from "./view"; // NOTE: much of this file was inspired (or taken) from the rust-analyzer extension. // See: https://github.com/rust-lang/rust-analyzer/blob/master/editors/code/src/ctx.ts#L1 +// TODO: opening obligations / trees need to be cancellable. + export type Workspace = | { kind: "empty" } | { kind: "workspace-folder" } @@ -138,15 +141,20 @@ export class Ctx { showErrorDialog("Failed to setup Argus"); return; } + vscode.window.showInformationMessage( "Loading Argus, this may take several minutes." ); + await b(["preload"], true); this.cache = new BackendCache(b); - await Promise.all( - _.map(this.visibleEditors, editor => this.openEditor(editor)) - ); + let openingEditor = new Promise(() => []); + if (this.activeRustEditor) { + openingEditor = Promise.all( + _.map(this.visibleEditors, e => this.openEditor(e)) + ); + } // Register the commands with VSCode after the backend is setup. this.updateCommands(); @@ -191,9 +199,14 @@ export class Ctx { isDocumentInWorkspace(editor.document) ) { this.cache.havoc(); - this.view!.reset(await this.getFreshWebViewData()); + this.view!.havoc(); + if (this.activeRustEditor) { + this.openEditor(this.activeRustEditor); + } } }); + + await openingEditor; } get visibleEditors(): RustEditor[] { @@ -202,12 +215,12 @@ export class Ctx { private async openEditor(editor: RustEditor) { // Load the obligations in the file, while we have the editor. - const obl = await this.loadObligations(editor); + const [obl, sig] = await this.loadObligations(editor); if (obl) { if (this.view === undefined) { console.debug("View not initialized, skipping editor open."); } - return this.view?.openEditor(editor, obl); + return this.view?.openEditor(editor, sig, obl); } } @@ -218,16 +231,19 @@ export class Ctx { // Here we load the obligations for a file, and cache the results, // there's a distinction between having an editor and not because // we only have definitive access to the editor when it's visible. - private async loadObligations(editor: RustEditor) { - const obligations = await this.cache.getObligationsInBody( + private async loadObligations( + editor: RustEditor + ): Promise<[ObligationsInBody[] | undefined, string]> { + const [obligationsP, sig] = this.cache.getObligationsInBody( editor.document.fileName ); + const obligations = await obligationsP; if (obligations === undefined) { - return; + return [undefined, sig]; } this.refreshDiagnostics(editor, obligations); - return obligations; + return [obligations, sig]; } async getObligations(filename: Filename) { @@ -260,8 +276,8 @@ export class Ctx { type: "trait" | "ambig"; } - const info = - (await this.cache.getObligationsInBody(document.fileName)) ?? []; + const [infoP, _sig] = this.cache.getObligationsInBody(document.fileName); + const info = (await infoP) ?? []; const traitRecs: Rec[] = _.flatMap(info, ob => _.map(ob.traitErrors, e => ({ @@ -390,17 +406,15 @@ export class Ctx { ); } - private async getFreshWebViewData(): Promise< - [Filename, ObligationsInBody[]][] - > { + private async getFreshWebViewData() { const initialData = await Promise.all( _.map(this.visibleEditors, async e => [ e.document.fileName, - await this.cache.getObligationsInBody(e.document.fileName), + await this.cache.getObligationsInBody(e.document.fileName)[0], ]) ); - // FIXME: how to make TS figure this out? - return _.filter(initialData, ([_, obl]) => obl !== undefined) as any; + const f = _.filter(initialData, ([_, obl]) => obl !== undefined); + return f as [Filename, ObligationsInBody[]][]; } private updateCommands() { @@ -416,10 +430,11 @@ export class Ctx { } } +// TODO: all running operations on the system need to be cancellable. class BackendCache { private obligationCache: Record< Filename, - Promise + [Promise, string] >; private treeCache: Record< Filename, @@ -438,7 +453,7 @@ class BackendCache { this.treeCache = {}; } - async getObligationsInBody(filename: Filename) { + getObligationsInBody(filename: Filename) { if (this.obligationCache[filename] !== undefined) { return this.obligationCache[filename]; } @@ -454,18 +469,17 @@ class BackendCache { return res.value; }; - this.obligationCache[filename] = thunk(); - return await this.obligationCache[filename]; + this.obligationCache[filename] = [thunk(), makeid(8)] as [ + Promise, + string + ]; + return this.obligationCache[filename]; } - async getTreeForObligation( - filename: Filename, - obl: Obligation, - range: CharRange - ) { + getTreeForObligation(filename: Filename, obl: Obligation, range: CharRange) { if (this.treeCache[filename] !== undefined) { if (this.treeCache[filename][obl.hash] !== undefined) { - return await this.treeCache[filename][obl.hash]; + return this.treeCache[filename][obl.hash]; } } else { this.treeCache[filename] = {}; @@ -506,6 +520,6 @@ class BackendCache { }; this.treeCache[filename][obl.hash] = thunk(); - return await this.treeCache[filename][obl.hash]; + return this.treeCache[filename][obl.hash]; } } diff --git a/ide/packages/extension/src/setup.ts b/ide/packages/extension/src/setup.ts index d2bd754..5b8c0ed 100644 --- a/ide/packages/extension/src/setup.ts +++ b/ide/packages/extension/src/setup.ts @@ -112,7 +112,9 @@ const checkVersionAndInstall = async ( cargo, [...cargoArgs, "argus", "-V"], "Waiting for Argus...", - { cwd: workspaceRoot } + { + cwd: workspaceRoot, + } ); } catch (e) { version = ""; diff --git a/ide/packages/extension/src/utils.ts b/ide/packages/extension/src/utils.ts index 833030e..c48ab81 100644 --- a/ide/packages/extension/src/utils.ts +++ b/ide/packages/extension/src/utils.ts @@ -4,6 +4,19 @@ import vscode from "vscode"; export type RustDocument = vscode.TextDocument & { languageId: "rust" }; export type RustEditor = vscode.TextEditor & { document: RustDocument }; +export function makeid(length: number) { + let result = ""; + const characters = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + const charactersLength = characters.length; + let counter = 0; + while (counter < length) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + counter += 1; + } + return result; +} + export function isRustDocument( document: vscode.TextDocument ): document is RustDocument { diff --git a/ide/packages/extension/src/view.ts b/ide/packages/extension/src/view.ts index b88c4f4..dea14ae 100644 --- a/ide/packages/extension/src/view.ts +++ b/ide/packages/extension/src/view.ts @@ -17,7 +17,6 @@ import { SystemToPanoptesMsg, configToString, isPanoMsgAddHighlight, - isPanoMsgObligations, isPanoMsgRemoveHighlight, isPanoMsgTree, } from "@argus/common/lib"; @@ -109,11 +108,10 @@ export class View { // Public API, using static methods >:( - public async reset(newData: [Filename, ObligationsInBody[]][]) { - this.messageWebview("reset", { + public async havoc() { + this.messageWebview("havoc", { type: "FROM_EXTENSION", - command: "reset", - data: newData, + command: "havoc", }); } @@ -133,22 +131,24 @@ export class View { }); } - public async openEditor(editor: RustEditor, data: ObligationsInBody[]) { + public async openEditor( + editor: RustEditor, + signature: string, + data: ObligationsInBody[] + ) { console.debug("Sending open file message", editor.document.fileName); this.messageWebview("open-file", { type: "FROM_EXTENSION", command: "open-file", file: editor.document.fileName, + signature, data, }); } private async handleMessage(message: BlessedMessage) { const { requestId, payload } = message; - - if (isPanoMsgObligations(payload)) { - return this.getObligations(requestId, payload.file); - } else if (isPanoMsgTree(payload)) { + if (isPanoMsgTree(payload)) { return this.getTree( requestId, payload.file, @@ -162,18 +162,6 @@ export class View { } } - private async getObligations(requestId: string, host: Filename) { - const obligations = await globals.ctx.getObligations(host); - if (obligations !== undefined) { - this.messageWebview(requestId, { - type: "FROM_EXTENSION", - file: host, - command: "obligations", - obligations: obligations, - }); - } - } - private async getTree( requestId: string, file: Filename, diff --git a/ide/packages/panoptes/src/App.tsx b/ide/packages/panoptes/src/App.tsx index fa89c0a..afe5bb1 100644 --- a/ide/packages/panoptes/src/App.tsx +++ b/ide/packages/panoptes/src/App.tsx @@ -1,12 +1,13 @@ +import { ObligationsInBody } from "@argus/common/bindings"; import { ErrorJumpTargetInfo, EvaluationMode, + Filename, PanoptesConfig, SystemSpec, - isSysMsg, + isSysMsgHavoc, isSysMsgOpenError, isSysMsgOpenFile, - isSysMsgReset, } from "@argus/common/lib"; import _ from "lodash"; import { observer } from "mobx-react"; @@ -33,8 +34,19 @@ const webSysSpec: SystemSpec = { vscodeVersion: "unknown", }; +function buildInitialData( + config: PanoptesConfig +): [Filename, ObligationsInBody[]][] { + if (config.type === "VSCODE_BACKING") { + return config.data; + } + + const byName = _.groupBy(config.closedSystem, body => body.filename); + return _.map(byName, (bodies, fn) => [fn, _.map(bodies, b => b.body)]); +} + const App = observer(({ config }: { config: PanoptesConfig }) => { - const [openFiles, setOpenFiles] = useState(config.data); + const [openFiles, setOpenFiles] = useState(buildInitialData(config)); const messageSystem = config.type === "WEB_BUNDLE" ? createClosedMessageSystem(config.closedSystem) @@ -55,24 +67,20 @@ const App = observer(({ config }: { config: PanoptesConfig }) => { payload: any; } = e.data; - if (!isSysMsg(payload)) return; console.debug("Received message from system", payload); if (isSysMsgOpenError(payload)) { return blingObserver(payload); } else if (isSysMsgOpenFile(payload)) { return setOpenFiles(currFiles => { - const idx = _.findIndex( + const files = _.filter( currFiles, - ([filename, _]) => filename === payload.file + ([filename, _]) => filename !== payload.file ); - if (idx === -1) { - return [[payload.file, payload.data], ...currFiles]; - } - return bringToFront(currFiles, idx); + return [[payload.file, payload.data], ...files]; }); - } else if (isSysMsgReset(payload)) { - return setOpenFiles(payload.data); + } else if (isSysMsgHavoc(payload)) { + return setOpenFiles([]); } }; diff --git a/ide/packages/panoptes/src/BodyInfo.ts b/ide/packages/panoptes/src/BodyInfo.ts index 7ac7784..341dd56 100644 --- a/ide/packages/panoptes/src/BodyInfo.ts +++ b/ide/packages/panoptes/src/BodyInfo.ts @@ -17,7 +17,7 @@ class BodyInfo { constructor( private readonly oib: ObligationsInBody, readonly idx: number, - readonly viewHiddenObligations: boolean = false + readonly viewHiddenObligations: boolean = true ) {} get hash(): BodyHash { diff --git a/ide/packages/panoptes/src/File.tsx b/ide/packages/panoptes/src/File.tsx index 4da3c8b..56645a5 100644 --- a/ide/packages/panoptes/src/File.tsx +++ b/ide/packages/panoptes/src/File.tsx @@ -257,8 +257,9 @@ const Expr = observer(({ idx }: { idx: ExprIdx }) => { ); if ( - !bodyInfo.isErrorMethodCall(expr) && - bodyInfo.visibleObligations(idx).length === 0 + (expr.isBody && !bodyInfo.showHidden) || + (!bodyInfo.isErrorMethodCall(expr) && + bodyInfo.visibleObligations(idx).length === 0) ) { return null; } @@ -360,7 +361,7 @@ const File = ({ const noBodiesFound = (

- Argus didn't find any 'interesting' obligations in this file. If you + Argus didn’t find any “interesting” obligations in this file. If you think there should be, please click below to report this as a bug!

; } const treeInfo = TreeInfo.new(tree, showHidden); if (treeInfo === undefined) { + console.error("Failed to create tree view"); return ; } diff --git a/ide/packages/panoptes/src/TreeView/TreeInfo.ts b/ide/packages/panoptes/src/TreeView/TreeInfo.ts index 61d7f0b..9f201e1 100644 --- a/ide/packages/panoptes/src/TreeView/TreeInfo.ts +++ b/ide/packages/panoptes/src/TreeView/TreeInfo.ts @@ -10,6 +10,8 @@ import { } from "@argus/common/bindings"; import _ from "lodash"; +import { isHiddenObl } from "../utilities/func"; + type MultiRecord = Record; type Direction = "to-root" | "from-root"; @@ -45,6 +47,7 @@ function makeTreeView( let newPrev = prev; switch (cf(curr)) { case "keep": { + console.debug("keep", curr); if (prev !== undefined) { addChildRel(prev, curr); } @@ -52,14 +55,17 @@ function makeTreeView( break; } case "remove-node": + console.debug("remove-node", curr); break; case "remove-tree": + console.debug("remove-tree", curr); return; } _.forEach(kids, kid => iterate(kid, newPrev)); }; iterate(root); + console.debug(`CF for root ${root} ${cf(root)}`); if (children[root] !== undefined) { return { @@ -90,9 +96,9 @@ export class TreeInfo { const node = tree.nodes[n]; if ("Goal" in node) { - return "keep"; - // const goalData = tree.goals[node.Goal]; + const goalData = tree.goals[node.Goal]; // const result = tree.results[goalData.result]; + return "keep"; // return isHiddenObl({ necessity: goalData.necessity, result }) // ? "remove-tree" // : "keep"; diff --git a/ide/packages/panoptes/src/print/print.tsx b/ide/packages/panoptes/src/print/print.tsx index 9b84927..20cc0d9 100644 --- a/ide/packages/panoptes/src/print/print.tsx +++ b/ide/packages/panoptes/src/print/print.tsx @@ -12,6 +12,7 @@ import ReportBugUrl from "../ReportBugUrl"; import "./print.css"; import { PrintImplHeader as UnsafePrintImplHeader } from "./private/argus"; import { PrintDefPath as UnsafePrintDefPath } from "./private/path"; +import { ToggleGenericDelimiterContext } from "./private/path"; import { PrintGoalPredicate as UnsafePrintGoalPredicate, PrintPredicateObligation as UnsafePrintPredicateObligation, @@ -71,17 +72,21 @@ export const PrintTy = ({ ty }: { ty: any }) => { export const PrintObligation = ({ obligation }: { obligation: Obligation }) => { const InnerContent = () => ( - + + + ); return ; }; export const PrintImplHeader = ({ impl }: { impl: any }) => { return ( - } - /> + + } + /> + ); }; @@ -91,10 +96,10 @@ export const PrintGoal = ({ o }: { o: GoalData }) => {
{o.debugComparison}
); const Content = () => ( - <> + {debugString} - + ); return ; }; diff --git a/ide/packages/panoptes/src/print/private/argus.tsx b/ide/packages/panoptes/src/print/private/argus.tsx index 7f2725b..a87c46b 100644 --- a/ide/packages/panoptes/src/print/private/argus.tsx +++ b/ide/packages/panoptes/src/print/private/argus.tsx @@ -13,7 +13,7 @@ import { anyElems } from "../../utilities/func"; import { PrintDefPath } from "./path"; import { PrintClause } from "./predicate"; import { Angled, CommaSeparated, Kw, PlusSeparated } from "./syntax"; -import { PrintGenericArg, PrintImplPolarity, PrintRegion, PrintTy } from "./ty"; +import { PrintGenericArg, PrintPolarity, PrintRegion, PrintTy } from "./ty"; export const PrintImplHeader = ({ o }: { o: ImplHeader }) => { console.debug("Printing ImplHeader", o); @@ -117,7 +117,7 @@ const PrintClauseBound = ({ o }: { o: ClauseBound }) => { const [polarity, path] = o.Trait; return ( <> - + ); diff --git a/ide/packages/panoptes/src/print/private/hir.css b/ide/packages/panoptes/src/print/private/hir.css deleted file mode 100644 index ac6b4ca..0000000 --- a/ide/packages/panoptes/src/print/private/hir.css +++ /dev/null @@ -1,16 +0,0 @@ -.WhereConstraintArea { - display: flex; - flex-direction: column; - padding: 0.25em; -} - -span.where { - padding: 0.15em; - border: 1px solid var(--vscode-widget-border); - border-radius: 5px; -} - -span.where:hover { - font-weight: bold; - opacity: 0.75; -} \ No newline at end of file diff --git a/ide/packages/panoptes/src/print/private/hir.tsx b/ide/packages/panoptes/src/print/private/hir.tsx deleted file mode 100644 index ebd204c..0000000 --- a/ide/packages/panoptes/src/print/private/hir.tsx +++ /dev/null @@ -1,661 +0,0 @@ -// import { -// AnonConst, -// GenericArgs, -// GenericBound, -// GenericParam, -// Generics, -// Ident, -// Impl, -// Lifetime, -// MutTy, -// Mutability, -// ParamName, -// Path, -// PathSegment, -// PolyTraitRef, -// QPath, -// Symbol, -// Term, -// TraitRef, -// Ty, -// TyKind, -// TypeBinding, -// } from "@argus/common/bindings"; -// import _ from "lodash"; -// import React from "react"; - -// import { HoverInfo } from "../../HoverInfo"; -// import { Toggle } from "../../Toggle"; -// import "./hir.css"; -// import * as kw from "./syntax"; -// import { Kw } from "./syntax"; - -// function isObject(x: any): x is object { -// return typeof x === "object" && x !== null; -// } - -// const genericArgsNone: GenericArgs = { -// args: [], -// bindings: [], -// parenthesized: "No", -// }; - -// const CommaSeparated = ({ children }: React.PropsWithChildren) => { -// return ( -// -// {React.Children.map(children, (child, i) => ( -// -// {i > 0 ? ", " : ""} -// {child} -// -// ))} -// -// ); -// }; - -// const Angled = ({ children }: React.PropsWithChildren) => { -// const [lt, gt] = ["<", ">"]; -// return ( -// -// {lt} -// {children} -// {gt} -// -// ); -// }; - -// function paramName(param: ParamName): Ident { -// return param === "Error" || param === "Fresh" -// ? kw.UnderscoreLifetime -// : param.Plain; -// } - -// export const PrintImpl = ({ impl }: { impl: Impl }) => { -// console.debug("Printing Impl", impl); - -// const generics = -// impl.generics.params.length === 0 ? null : ( -// -// {" "} -// -// ); - -// const polarity = impl.polarity === "Positive" ? null : "!"; - -// const ofTrait = -// impl.of_trait !== undefined ? ( -// -// for{" "} -// -// ) : null; - -// return ( -// -// impl -// {generics} -// {polarity} -// {ofTrait} -// -// -// -// ); -// }; - -// const PrintWhereClause = ({ generics }: { generics: Generics }) => { -// if (generics.predicates.length === 0) { -// return ""; -// } - -// const whereHoverContent = () => ( -//
-// {_.map(generics.predicates, (pred, idx) => { -// const innerContent = -// "BoundPredicate" in pred ? ( -// -// -// -// -// -// ) : "RegionPredicate" in pred ? ( -// -// : -// {_.map(pred.RegionPredicate.bounds, (bound, idx) => -// "Outlives" in bound ? ( -// -// ) : ( -// "ERROR UNKNOWN" -// ) -// )} -// -// ) : "EqPredicate" in pred ? ( -// -// ={" "} -// -// -// ) : ( -// "" -// ); - -// return ( -//
-// {innerContent} -//
-// ); -// })} -//
-// ); - -// return ( -// -// {" "} -// where{" "} -// -// ... -// -// -// ); -// }; - -// const PrintGenericsParams = ({ generics }: { generics: Generics }) => { -// const params = generics.params; -// if (params.length == 0) { -// return ""; -// } - -// const innerElems = _.map(params, (param, idx) => ( -// -// )); - -// return ( -// -// {innerElems}} -// /> -// -// ); -// }; - -// const PrintGenericParam = ({ param }: { param: GenericParam }) => { -// const prefix = "Const" in param.kind ? "const " : ""; -// const ident = ; -// const after = -// "Lifetime" in param.kind ? ( -// "" -// ) : "Type" in param.kind && param.kind.Type.default !== undefined ? ( -// -// {" = "} -// {} -// -// ) : "Const" in param.kind ? ( -// -// {": "} -// -// {param.kind.Const.default !== undefined ? ( -// -// {" = "} -// -// -// ) : ( -// "" -// )} -// -// ) : ( -// "" -// ); - -// return ( -// -// {prefix} -// {ident} -// {after} -// -// ); -// }; - -// const PrintAnonConst = ({ anon }: { anon: AnonConst }) => { -// return "TODO: anonconst"; -// }; - -// const PrintIdent = ({ ident }: { ident: Ident }) => { -// return {ident.name}; -// }; - -// const PrintTraitRef = ({ traitRef }: { traitRef: TraitRef }) => { -// return ; -// }; - -// const PrintPath = ({ -// path, -// colonsBefore = false, -// }: { -// path: Path; -// colonsBefore?: boolean; -// }) => { -// return ( -// -// {_.map(path.segments, (segment, idx) => ( -// -// {idx > 0 ? "::" : ""} -// {segment.ident !== kw.PathRoot ? ( -// <> -// -// -// -// ) : ( -// "" -// )} -// -// ))} -// -// ); -// }; - -// function genericArgsInputs(args: GenericArgs): Ty[] | undefined { -// if (args.parenthesized !== "ParenSugar") { -// return; -// } - -// for (let arg of args.args) { -// if ("Type" in arg && isObject(arg.Type.kind) && "Tup" in arg.Type.kind) { -// return arg.Type.kind.Tup; -// } -// } -// } - -// function genericArgsReturn(args: GenericArgs): Ty | undefined { -// const bk = _.first(args.bindings)?.kind; -// if (bk !== undefined && "Equality" in bk) { -// if ("Ty" in bk.Equality.term) { -// return bk.Equality.term.Ty; -// } -// } -// } - -// const PrintGenericArgs = ({ -// args, -// colonBefore, -// }: { -// args: GenericArgs | undefined; -// colonBefore: boolean; -// }) => { -// const uArgs = args ?? genericArgsNone; - -// switch (uArgs.parenthesized) { -// case "No": { -// // SEE: https://github.com/rust-lang/rust/blob/0ea334ab739265168fba366afcdc7ff68c1dec53/compiler/rustc_hir_pretty/src/lib.rs#L1620 -// const start = colonBefore ? "::<" : "<"; -// let empty = true; -// // TODO: wtf is this???? -// const startOrComma = () => { -// if (empty) { -// empty = false; -// return start; -// } else { -// return ", "; -// } -// }; - -// // SEE https://github.com/rust-lang/rust/blob/0ea334ab739265168fba366afcdc7ff68c1dec53/compiler/rustc_hir_pretty/src/lib.rs#L1632-L1643 -// // for when we want to make eliding arguments possible. -// let nonelidedGenericArgs = uArgs.args.length > 0; - -// let nonElided = !nonelidedGenericArgs -// ? "" -// : (() => { -// const prefix = startOrComma(); -// const commsep = ( -// { -// if ("Lifetime" in genA) { -// return ; -// } else if ("Type" in genA) { -// return ; -// } else if ("Const" in genA) { -// return ; -// } else if ("Infer" in genA) { -// return "_"; -// } -// })} -// /> -// ); -// return ( -// -// {prefix} -// {commsep} -// -// ); -// })(); - -// const bindings = _.map(uArgs.bindings, (binding, idx) => ( -// -// {startOrComma()} -// -// -// )); - -// const end = empty ? "" : ">"; - -// return ( -// -// {nonElided} -// {bindings} -// {end} -// -// ); -// } -// case "ParenSugar": { -// const inputs = genericArgsInputs(uArgs); -// const argList = ( -// -// ( -// ( -// -// ))} -// /> -// ) -// -// ); -// const arr = " -> "; -// const ret = ; - -// return ( -// -// {argList} -// {arr} -// {ret} -// -// ); -// } -// case "ReturnTypeNotation": { -// return "(..)"; -// } -// } -// }; - -// const PrintTerm = ({ term }: { term: Term }) => { -// if ("Ty" in term) { -// return ; -// } else if ("Const" in term) { -// return ; -// } -// }; - -// const PrintBounds = ({ -// prefix, -// bounds, -// }: { -// prefix: string; -// bounds: GenericBound[]; -// }) => { -// return ( -// -// {_.map(bounds, (bound, idx) => { -// const prfx = idx == 0 ? (prefix.length > 0 ? prefix + " " : "") : "+ "; -// if ("Trait" in bound) { -// const mb = bound.Trait[1] === "Maybe" ? "?" : ""; -// return ( -// -// {prfx} -// {mb} -// -// -// ); -// } else if ("Outlives" in bound) { -// return ( -// -// {prfx} -// -// -// ); -// } -// })} -// -// ); -// }; - -// const PrintPolyTraitRef = ({ pTraitRef }: { pTraitRef: PolyTraitRef }) => { -// return ( -// <> -// -// -// -// ); -// }; - -// const PrintFormalGenericParams = ({ params }: { params: GenericParam[] }) => { -// if (params.length === 0) { -// return ""; -// } - -// return ( -// -// for -// -// -// ); -// }; - -// const PrintGenericParams = ({ params }: { params: GenericParam[] }) => { -// if (params.length == 0) { -// return ""; -// } -// const inner = ( -// ( -// -// ))} -// /> -// ); -// return {inner}; -// }; - -// const PrintTypeBinding = ({ binding }: { binding: TypeBinding }) => { -// const id = ; -// const genArgs = ( -// -// ); -// const rest = -// "Equality" in binding.kind ? ( -// -// {"= "} -// -// -// ) : "Constraint" in binding.kind ? ( -// -// ) : ( -// "" -// ); -// return ( -// -// {id} -// {genArgs} {rest} -// -// ); -// }; - -// const PrintTy = ({ ty }: { ty: Ty }) => { -// return ; -// }; - -// const PrintTyKind = ({ tyKind }: { tyKind: TyKind }) => { -// if (tyKind === "Never") { -// return "!"; -// } else if (tyKind === "Infer") { -// return "_"; -// } else if (tyKind === "Err") { -// return "/*ERROR*/"; -// } else if ("InferDelegation" in tyKind) { -// return "_"; -// } else if ("Slice" in tyKind) { -// return ( -// -// [] -// -// ); -// } else if ("Ptr" in tyKind) { -// return ( -// -// * -// -// ); -// } else if ("Ref" in tyKind) { -// const [lifetime, ty] = tyKind.Ref; -// return ( -// -// & -// -// -// ); -// } else if ("Tup" in tyKind) { -// return ( -// ( -// -// ))} -// /> -// ); -// } else if ("BareFn" in tyKind) { -// return "TODO: BAREFN"; -// } else if ("OpaqueDef" in tyKind) { -// return "TODO: OPAQUEDEF"; -// } else if ("Path" in tyKind) { -// return ; -// } else if ("TraitObject" in tyKind) { -// return "TODO: TRAITOBJECT"; -// } else if ("Array" in tyKind) { -// return "TODO: ARRAY"; -// } else if ("Typeof" in tyKind) { -// return ( -// -// typeof -// -// ); -// } -// }; - -// const PrintMutTy = ({ -// mty, -// printConst = true, -// }: { -// mty: MutTy; -// printConst?: boolean; -// }) => { -// return ( -// <> -// -// -// -// ); -// }; - -// const PrintMutability = ({ -// mtbl, -// printConst, -// }: { -// mtbl: Mutability; -// printConst: boolean; -// }) => { -// return mtbl === "Mut" ? "mut " : printConst ? "const " : ""; -// }; - -// const PrintLifetime = ({ lifetime }: { lifetime: Lifetime }) => { -// return ; -// }; - -// const PrintQPath = ({ -// qpath, -// colonsBefore, -// }: { -// qpath: QPath; -// colonsBefore: boolean; -// }) => { -// if ("LangItem" === qpath) { -// return "#[lang = (...)]"; -// } else if ("Resolved" in qpath && qpath.Resolved[0] === null) { -// return ; -// } else if ("Resolved" in qpath && qpath.Resolved[0] !== null) { -// const [ty, path] = qpath.Resolved; -// const inner = ( -// -// -// {" as "} -// -// ); -// const listed = _.map(path.segments.slice(-1), (seg, idx) => { -// const prefix = idx > 0 ? "::" : ""; -// return ( -// -// {prefix} -// -// -// ); -// }); -// const angles = ( -// -// -// {inner} -// {listed} -// -// -// ); -// const lastSegment = ( -// -// ); -// return ( -// -// {angles}::{lastSegment} -// -// ); -// } else if ("TypeRelative" in qpath) { -// const [ty, segment] = qpath.TypeRelative; -// // FIXME: woof ... -// const prefix = -// isObject(ty.kind) && -// "Path" in ty.kind && -// isObject(ty.kind.Path) && -// "Resolved" in ty.kind.Path && -// ty.kind.Path.Resolved[0] === undefined ? ( -// -// ) : ( -// -// -// -// ); -// return ( -// -// {prefix}:: -// -// -// ); -// } -// }; - -// const PrintPathSegment = ({ -// segment, -// colonsBefore = false, -// }: { -// segment: PathSegment; -// colonsBefore?: boolean; -// }) => { -// if (segment.ident === kw.PathRoot) { -// return ""; -// } - -// return ( -// <> -// -// -// -// ); -// }; diff --git a/ide/packages/panoptes/src/print/private/path.tsx b/ide/packages/panoptes/src/print/private/path.tsx index 31f3266..1e89061 100644 --- a/ide/packages/panoptes/src/print/private/path.tsx +++ b/ide/packages/panoptes/src/print/private/path.tsx @@ -1,12 +1,40 @@ import { DefinedPath, PathSegment } from "@argus/common/bindings"; import _ from "lodash"; -import React from "react"; +import React, { createContext, useContext } from "react"; import { HoverInfo } from "../../HoverInfo"; +import { Toggle } from "../../Toggle"; import { takeRightUntil } from "../../utilities/func"; import { Angled, CommaSeparated, Kw } from "./syntax"; import { PrintGenericArg, PrintTy } from "./ty"; +// Change this to true if we want to by default toggle type parameter lists +export const ToggleGenericDelimiterContext = createContext(false); + +// Special case the printing for associated types. Things that look like +// `::AssocType`, we want to print this as `<...>::AssocType` so that +// people can visually see that this is an associated type. +function isAssociatedType( + o: DefinedPath +): o is [PathSegment & { type: "GenericDelimiters" }, ...DefinedPath] { + return o.length > 1 && o[0].type === "GenericDelimiters"; +} + +function pruneToShortPath(o: DefinedPath): [DefinedPath, DefinedPath] { + // Take the rightmost segments that form a full "path". + const prefix = takeRightUntil( + o, + segment => + segment.type === "Ty" || + segment.type === "DefPathDataName" || + segment.type === "Impl" + ); + + // Take the leftmost segments that are named, these will have a hover + // element attached to them. + return [[prefix[0]], _.slice(prefix, 1)]; +} + export const PrintValuePath = ({ o }: { o: DefinedPath }) => { return ; }; @@ -27,34 +55,56 @@ export const PrintDefPath = ({ o }: { o: DefinedPath }) => { ); - const [prefix, rest] = pruneToShortPath(o); - - return ( -
- - - - - - -
- ); -}; + const PrintAsGenericPath = ({ + Prefix, + Rest, + }: { + Prefix: React.FC; + Rest: React.FC; + }) => { + return ( +
+ + + + + + +
+ ); + }; -function pruneToShortPath(o: DefinedPath): [DefinedPath, DefinedPath] { - // Take the rightmost segments that form a full "path". - const prefix = takeRightUntil( + const PrintAsAssociatedType = ({ o, - segment => - segment.type === "Ty" || - segment.type === "DefPathDataName" || - segment.type === "Impl" - ); + }: { + o: [PathSegment & { type: "GenericDelimiters" }, ...DefinedPath]; + }) => { + return ( + ( + + + + )} + Rest={() => } + /> + ); + }; - // Take the leftmost segments that are named, these will have a hover - // element attached to them. - return [[prefix[0]], _.slice(prefix, 1)]; -} + return isAssociatedType(o) ? ( + + ) : ( + (() => { + const [prefix, rest] = pruneToShortPath(o); + return ( + } + Rest={() => } + /> + ); + })() + ); +}; export const PrintDefPathFull = ({ o }: { o: DefinedPath }) => { return ; @@ -109,10 +159,21 @@ export const PrintPathSegment = ({ o }: { o: PathSegment }) => { if (o.inner.length === 0) { return null; } + const useToggle = useContext(ToggleGenericDelimiterContext); return ( - - - + // TODO: do we want to allow nested toggles? + + + {useToggle ? ( + } + > + ) : ( + + )} + + ); } case "CommaSeparated": { @@ -122,9 +183,7 @@ export const PrintPathSegment = ({ o }: { o: PathSegment }) => { : ({ o }: { o: any }) => { throw new Error("Unknown comma separated kind", o); }; - const components = _.map(o.entries, entry => () => ); - return ; } default: diff --git a/ide/packages/panoptes/src/print/private/predicate.tsx b/ide/packages/panoptes/src/print/private/predicate.tsx index d9d6c3b..86c3f9b 100644 --- a/ide/packages/panoptes/src/print/private/predicate.tsx +++ b/ide/packages/panoptes/src/print/private/predicate.tsx @@ -21,10 +21,10 @@ import { PrintConst } from "./const"; import { PrintDefPath } from "./path"; import { PrintTerm } from "./term"; import { - PrintAliasTy, + PrintAliasTerm, PrintBinder, PrintGenericArg, - PrintImplPolarity, + PrintPolarity, PrintRegion, PrintTy, } from "./ty"; @@ -111,7 +111,7 @@ export const PrintPredicateKind = ({ o }: { o: PredicateKind }) => { } else if ("NormalizesTo" in o) { return ( <> - normalizes to{" "} + normalizes to{" "} ); @@ -160,7 +160,8 @@ export const PrintClauseKind = ({ o }: { o: ClauseKind }) => { const proj = o.Projection; return ( - == + =={" "} + ); } else if ("ConstArgHasType" in o) { @@ -199,7 +200,7 @@ export const PrintTraitPredicate = ({ o }: { o: TraitPredicate }) => { return ( <> : - + ); diff --git a/ide/packages/panoptes/src/print/private/term.tsx b/ide/packages/panoptes/src/print/private/term.tsx index f833deb..b7d6856 100644 --- a/ide/packages/panoptes/src/print/private/term.tsx +++ b/ide/packages/panoptes/src/print/private/term.tsx @@ -36,7 +36,15 @@ export const PrintTerm = ({ o }: { o: Term }) => { export const PrintExpr = ({ o }: { o: ExprDef }) => { if ("Binop" in o) { const [op, lhs, rhs] = o.Binop; - return ( + return op === "Cmp" ? ( + <> + + .cmp + + + + + ) : ( <> @@ -71,7 +79,9 @@ export const PrintExpr = ({ o }: { o: ExprDef }) => { } }; -const PrintBinOp = ({ o }: { o: BinOp }) => { +// NOTE: this is the mir BinOp enum so not all operators are "source representable." +// Exluding "Cmp" as it rearranges the operands and doesn't follow the pattern. +const PrintBinOp = ({ o }: { o: Exclude }) => { if (o === "Add") { return "+"; } else if (o === "AddUnchecked") { diff --git a/ide/packages/panoptes/src/print/private/ty.tsx b/ide/packages/panoptes/src/print/private/ty.tsx index 5d1360d..e18a22b 100644 --- a/ide/packages/panoptes/src/print/private/ty.tsx +++ b/ide/packages/panoptes/src/print/private/ty.tsx @@ -1,10 +1,12 @@ import { Abi, + AliasTerm, AliasTy, AliasTyKind, AssocItem, BoundTy, BoundVariable, + CoroutineClosureTyKind, CoroutineTyKind, CoroutineWitnessTyKind, DynamicTyKind, @@ -13,12 +15,12 @@ import { FnSig, FnTrait, GenericArg, - ImplPolarity, InferTy, IntTy, OpaqueImpl, ParamTy, PlaceholderBoundTy, + Polarity, PolyExistentialPredicates, PolyFnSig, Region, @@ -78,6 +80,9 @@ export const PrintTyKind = ({ o }: { o: TyKind }) => { return ; } else if ("Float" in o) { return ; + } else if ("Pat" in o) { + const [ty] = o.Pat; + return ; } else if ("Adt" in o) { return ; } else if ("Array" in o) { @@ -130,6 +135,8 @@ export const PrintTyKind = ({ o }: { o: TyKind }) => { return ; } else if ("Closure" in o) { return ; + } else if ("CoroutineClosure" in o) { + return ; } else if ("Param" in o) { return ; } else if ("Bound" in o) { @@ -163,6 +170,15 @@ export const PrintCoroutineTy = ({ o }: { o: CoroutineTyKind }) => { ); }; +export const PrintCoroutineClosureTy = ({ + o, +}: { + o: CoroutineClosureTyKind; +}) => { + // TODO: we can print other things known to the closure, like kind, signature, upvars, etc. + return ; +}; + export const PrintCoroutineWitnessTy = ({ o, }: { @@ -218,6 +234,10 @@ export const PrintAliasTyKind = ({ o }: { o: AliasTyKind }) => { } }; +export const PrintAliasTerm = ({ o }: { o: AliasTerm }) => { + return ; +}; + export const PrintAliasTy = ({ o }: { o: AliasTy }) => { switch (o.type) { case "PathDef": @@ -292,7 +312,7 @@ export const PrintPolyFnSig = ({ o }: { o: PolyFnSig }) => { }; const inner = (o: FnSig) => { - const unsafetyStr = o.unsafety === "Unsafe" ? "unsafe " : null; + const unsafetyStr = o.safety === "Unsafe" ? "unsafe " : null; const abi = ; const [inputs, output] = fnInputsAndOutput(o.inputs_and_output); return ( @@ -360,8 +380,6 @@ export const PrintInferTy = ({ o }: { o: InferTy }) => { ? () => float : o === "Unresolved" ? () => "_" - : "Named" in o - ? () => : "Unnamed" in o ? () => : "SourceInfo" in o @@ -439,8 +457,8 @@ export const PrintBoundVariable = ({ o }: { o: BoundVariable }) => { } }; -export const PrintImplPolarity = ({ o }: { o: ImplPolarity }) => { - return o === "Negative" ? "!" : null; +export const PrintPolarity = ({ o }: { o: Polarity }) => { + return o === "Negative" ? "!" : o === "Maybe" ? "?" : null; }; export const PrintOpaqueImplType = ({ o }: { o: OpaqueImpl }) => { @@ -477,7 +495,7 @@ export const PrintOpaqueImplType = ({ o }: { o: OpaqueImpl }) => { const PrintTrait = ({ o }: { o: Trait }) => { console.debug("Printing Trait", o); - const prefix = ; + const prefix = ; const name = ; const ownArgs = _.map(o.ownArgs, arg => () => ); const assocArgs = _.map(o.assocArgs, arg => () => ( diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 3d17d42..77f3e26 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-01-24" +channel = "nightly-2024-05-20" components = ["rust-src", "rustc-dev", "llvm-tools-preview"]