partway through extension

This commit is contained in:
2025-01-20 08:52:19 +00:00
parent 6e0605ea85
commit 8fd3f2af0f
12 changed files with 470 additions and 214 deletions

View File

@@ -11,8 +11,11 @@ use crate::api;
///
/// There are no ordering guarantees about these
pub trait ExtPort {
fn send(&self, msg: &[u8]) -> LocalBoxFuture<'_, ()>;
fn recv<'s, 'a: 's>(&'s self, cb: Box<dyn FnOnce(&[u8]) + 'a>) -> LocalBoxFuture<'a, ()>;
fn send<'a>(&'a self, msg: &'a [u8]) -> LocalBoxFuture<'a, ()>;
fn recv<'a, 's: 'a>(
&'s self,
cb: Box<dyn FnOnce(&[u8]) -> LocalBoxFuture<'a, ()> + 'a>,
) -> LocalBoxFuture<'a, ()>;
}
pub struct ExtInit {
@@ -21,7 +24,12 @@ pub struct ExtInit {
}
impl ExtInit {
pub async fn send(&self, msg: &[u8]) { self.port.send(msg).await }
pub async fn recv(&self, cb: impl FnOnce(&[u8]) + Send) { self.port.recv(Box::new(cb)).await }
pub async fn recv<'a, 's: 'a>(
&'s self,
cb: Box<dyn FnOnce(&[u8]) -> LocalBoxFuture<'a, ()> + 'a>,
) {
self.port.recv(Box::new(cb)).await
}
}
impl Deref for ExtInit {
type Target = api::ExtensionHeader;

View File

@@ -24,8 +24,8 @@ trait_set! {
pub trait SendFn<T: MsgSet> =
for<'a> FnMut(&'a [u8], ReqNot<T>) -> LocalBoxFuture<'a, ()>
+ DynClone + Send + 'static;
pub trait ReqFn<T: MsgSet> =
for<'a> FnMut(RequestHandle<'a, T>, <T::In as Channel>::Req) -> LocalBoxFuture<'a, Receipt<'a>>
pub trait ReqFn<T: MsgSet> = for<'a> FnMut(RequestHandle<'a, T>, <T::In as Channel>::Req)
-> LocalBoxFuture<'a, Receipt<'a>>
+ DynClone + Send + Sync + 'static;
pub trait NotifFn<T: MsgSet> =
FnMut(<T::In as Channel>::Notif, ReqNot<T>) -> LocalBoxFuture<'static, ()>

View File

@@ -31,10 +31,11 @@ async fn err_type(pos: Pos) -> OrcErr {
}
impl<A: AtomicFeatures> TryFromExpr for TypAtom<'_, A> {
fn try_from_expr(expr: Expr) -> OrcRes<Self> {
(expr.foreign_atom())
.map_err(|ex| err_not_atom(ex.pos.clone()).into())
.and_then(|f| downcast_atom(f).map_err(|f| err_type(f.pos).into()))
async fn try_from_expr(expr: Expr) -> OrcRes<Self> {
match expr.foreign_atom() {
Err(ex) => Err(err_not_atom(ex.pos.clone()).await.into()),
Ok(f) => match downcast_atom(f) \.map_err(|f| err_type(f.pos).into()),
}
}
}

View File

@@ -1,12 +1,17 @@
use std::io::Write;
use std::num::NonZero;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex};
use std::{mem, process, thread};
use async_std::channel::{Receiver, Sender};
use async_std::sync::Mutex;
use futures::FutureExt;
use futures::future::LocalBoxFuture;
use hashbrown::HashMap;
use itertools::Itertools;
use orchid_api_traits::{Decode, Encode, enc_vec};
use orchid_base::builtin::ExtPort;
use orchid_base::char_filter::{char_filter_match, char_filter_union, mk_char_filter};
use orchid_base::clone;
use orchid_base::interner::{Tok, init_replica, sweep_replica};
@@ -14,7 +19,7 @@ use orchid_base::logging::Logger;
use orchid_base::macros::{mtreev_from_api, mtreev_to_api};
use orchid_base::name::{PathSlice, Sym};
use orchid_base::parse::{Comment, Snippet};
use orchid_base::reqnot::{ReqHandlish, ReqNot, RequestHandle, Requester};
use orchid_base::reqnot::{Receipt, ReqHandlish, ReqNot, RequestHandle, Requester};
use orchid_base::tree::{ttv_from_api, ttv_to_api};
use substack::Substack;
@@ -55,18 +60,23 @@ pub struct SystemRecord {
lazy_members: HashMap<api::TreeId, MemberRecord>,
}
pub fn with_atom_record<T>(
pub async fn with_atom_record<T>(
get_sys_ctx: &impl Fn(api::SysId, ReqNot<api::ExtMsgSet>) -> SysCtx,
reqnot: ReqNot<api::ExtMsgSet>,
atom: &api::Atom,
cb: impl FnOnce(Box<dyn AtomDynfo>, SysCtx, api::AtomId, &[u8]) -> T,
cb: impl for<'c> FnOnce(
Box<dyn AtomDynfo>,
SysCtx,
api::AtomId,
&'c [u8],
) -> LocalBoxFuture<'c, T>,
) -> T {
let mut data = &atom.data[..];
let ctx = get_sys_ctx(atom.owner, reqnot);
let inst = ctx.cted.inst();
let id = api::AtomId::decode(&mut data);
let atom_record = atom_by_idx(inst.card(), id).expect("Atom ID reserved");
cb(atom_record, ctx, id, data)
cb(atom_record, ctx, id, data).await
}
pub fn extension_main(data: ExtensionData) {
@@ -83,7 +93,20 @@ pub fn extension_main(data: ExtensionData) {
pub struct ExtensionOwner {
rn: ReqNot<api::ExtMsgSet>,
onmessage: Mutex<OnMessage>,
out_recv: Receiver<Vec<u8>>,
out_send: Sender<Vec<u8>>,
}
impl ExtPort for ExtensionOwner {
fn send<'a>(&'a self, msg: &'a [u8]) -> LocalBoxFuture<'a, ()> {
self.rn.receive(msg).boxed_local()
}
fn recv<'a, 's: 'a>(
&'s self,
cb: Box<dyn FnOnce(&[u8]) -> LocalBoxFuture<'a, ()> + 'a>,
) -> LocalBoxFuture<'a, ()> {
async { cb(&self.out_recv.recv().await.unwrap()[..]).await }.boxed_local()
}
}
fn extension_main_logic(data: ExtensionData) {
@@ -99,25 +122,34 @@ fn extension_main_logic(data: ExtensionData) {
std::io::stdout().flush().unwrap();
let exiting = Arc::new(AtomicBool::new(false));
let logger = Arc::new(Logger::new(log_strategy));
let mk_ctx = clone!(logger, systems; move |id: api::SysId, reqnot: ReqNot<api::ExtMsgSet>| {
let cted = systems.lock().unwrap()[&id].cted.clone();
let mk_ctx = clone!(
logger, systems;
move |id: api::SysId, reqnot: ReqNot<api::ExtMsgSet>| async {
let cted = systems.lock().await[&id].cted.clone();
SysCtx { id, cted, logger: logger.clone(), reqnot }
});
}.boxed_local()
);
let rn = ReqNot::<api::ExtMsgSet>::new(
clone!(logger; move |a, _| {
clone!(logger; move |a, _| async {
logger.log_buf("Upsending", a);
send_parent_msg(a).unwrap()
}),
clone!(systems, exiting, mk_ctx; move |n, reqnot| match n {
send_parent_msg(a).await.unwrap()
}.boxed_local()),
clone!(systems, exiting, mk_ctx; move |n, reqnot| async {
match n {
api::HostExtNotif::Exit => exiting.store(true, Ordering::Relaxed),
api::HostExtNotif::SystemDrop(api::SystemDrop(sys_id)) =>
mem::drop(systems.lock().unwrap().remove(&sys_id)),
mem::drop(systems.lock().await.remove(&sys_id)),
api::HostExtNotif::AtomDrop(api::AtomDrop(sys_id, atom)) =>
OBJ_STORE.get(atom.0).unwrap().remove().dyn_free(mk_ctx(sys_id, reqnot)),
}),
clone!(systems, logger; move |hand, req| match req {
api::HostExtReq::Ping(ping@api::Ping) => hand.handle(&ping, &()),
api::HostExtReq::Sweep(sweep@api::Sweep) => hand.handle(&sweep, &sweep_replica()),
OBJ_STORE.get(atom.0).unwrap().remove().dyn_free(mk_ctx(sys_id, reqnot).await),
}
}.boxed_local()),
{
let systems = systems.clone();
let logger = logger.clone();
(move|hand,req|async {
let receipt:Receipt = match req {
api::HostExtReq::Ping(ping@api::Ping) => hand.handle(&ping, &()).await,
api::HostExtReq::Sweep(sweep@api::Sweep) => hand.handle(&sweep, &sweep_replica()).await,
api::HostExtReq::SysReq(api::SysReq::NewSystem(new_sys)) => {
let i = decls.iter().enumerate().find(|(_,s)|s.id==new_sys.system).unwrap().0;
let cted = data.systems[i].new_system(&new_sys);
@@ -128,31 +160,18 @@ fn extension_main_logic(data: ExtensionData) {
});
let mut lazy_mems = HashMap::new();
let ctx = SysCtx {
cted: cted.clone(),
id: new_sys.id,
logger: logger.clone(),
reqnot: hand.reqnot()
cted:cted.clone(),id:new_sys.id,logger:logger.clone(),reqnot:hand.reqnot()
};
let mut tia_ctx = TIACtxImpl {
lazy: &mut lazy_mems,
sys: ctx.clone(),
basepath: &[],
path: Substack::Bottom,
lazy: &mut lazy_mems,sys:ctx.clone(),basepath: &[],path:Substack::Bottom,
};
let const_root = (cted.inst().dyn_env().into_iter())
.map(|(k, v)| (k.to_api(), v.into_api(&mut tia_ctx)))
.collect();
let const_root = (cted.inst().dyn_env().into_iter()).map(|(k,v)|(k.to_api(),v.into_api(&mut tia_ctx))).collect();
systems.lock().unwrap().insert(new_sys.id,SystemRecord {
declfs: cted.inst().dyn_vfs().to_api_rec(&mut vfses),
vfses,
cted,
lazy_members: lazy_mems
declfs:cted.inst().dyn_vfs().to_api_rec(&mut vfses),vfses,cted,lazy_members:lazy_mems
});
hand.handle(&new_sys, &api::SystemInst {
lex_filter,
const_root,
line_types: vec![]
})
lex_filter,const_root,line_types:vec![]
}).await
}
api::HostExtReq::GetMember(get_tree@api::GetMember(sys_id,tree_id)) => {
let mut systems_g = systems.lock().unwrap();
@@ -162,18 +181,16 @@ fn extension_main_logic(data: ExtensionData) {
None => panic!("Tree for ID not found"),
Some(MemberRecord::Res) => panic!("This tree has already been transmitted"),
Some(MemberRecord::Gen(path,cb)) => (path,cb),
};
let tree = cb.build(path.clone());
hand.handle(&get_tree, &tree.into_api(&mut TIACtxImpl {
sys: SysCtx::new(sys_id, &sys.cted, &logger, hand.reqnot()),
path: Substack::Bottom,
basepath: &path,
lazy,
}))
sys:SysCtx::new(sys_id, &sys.cted, &logger,hand.reqnot()),path:Substack::Bottom,basepath: &path,lazy,
})).await
}
api::HostExtReq::VfsReq(api::VfsReq::GetVfs(get_vfs@api::GetVfs(sys_id))) => {
let systems_g = systems.lock().unwrap();
hand.handle(&get_vfs, &systems_g[&sys_id].declfs)
hand.handle(&get_vfs, &systems_g[&sys_id].declfs).await
}
api::HostExtReq::SysReq(api::SysReq::SysFwded(fwd)) => {
let api::SysFwded(sys_id,payload) = fwd;
@@ -185,15 +202,19 @@ fn extension_main_logic(data: ExtensionData) {
let api::VfsRead(sys_id,vfs_id,path) = &vfs_read;
let systems_g = systems.lock().unwrap();
let path = path.iter().map(|t|Tok::from_api(*t)).collect_vec();
hand.handle(&vfs_read, &systems_g[sys_id].vfses[vfs_id].load(PathSlice::new(&path)))
hand.handle(&vfs_read, &systems_g[sys_id].vfses[vfs_id].load(PathSlice::new(&path))).await
}
api::HostExtReq::LexExpr(lex @ api::LexExpr{ sys, text, pos, id }) => {
api::HostExtReq::LexExpr(lex@api::LexExpr {
sys,text,pos,id
}) => {
let systems_g = systems.lock().unwrap();
let lexers = systems_g[&sys].cted.inst().dyn_lexers();
mem::drop(systems_g);
let text = Tok::from_api(text);
let ctx = LexContext { sys, id, pos, reqnot: hand.reqnot(), text: &text };
let trigger_char = text.chars().nth(pos as usize).unwrap();
let ctx = LexContext {
sys,id,pos,reqnot:hand.reqnot(),text: &text
};
let trigger_char = text.await.chars().nth(pos as usize).unwrap();
for lx in lexers.iter().filter(|l|char_filter_match(l.char_filter(),trigger_char)){
match lx.lex(&text[pos as usize..], &ctx){
Err(e)if e.any(|e| *e==err_not_applicable()) => continue,
@@ -205,70 +226,81 @@ fn extension_main_logic(data: ExtensionData) {
let ctx = mk_ctx(sys,hand.reqnot());
let expr = expr.to_api(&mut |f,r|do_extra(f,r,ctx.clone()));
let pos = (text.len()-s.len())as u32;
return hand.handle(&lex, &Some(Ok(api::LexedExpr{ pos, expr })))
return hand.handle(&lex, &Some(Ok(api::LexedExpr {
pos,expr
})))
}
}
}
writeln!(logger, "Got notified about n/a character '{trigger_char}'");
hand.handle(&lex, &None)
}writeln!(logger,"Got notified about n/a character '{trigger_char}'");
hand.handle(&lex, &None).await
},
api::HostExtReq::ParseLine(pline) => {
let api::ParseLine{ exported, comments, sys, line } = &pline;
let api::ParseLine {
exported,comments,sys,line
} = &pline;
let mut ctx = mk_ctx(*sys,hand.reqnot());
let parsers = ctx.cted.inst().dyn_parsers();
let comments = comments.iter().map(Comment::from_api).collect();
let line:Vec<GenTokTree> = ttv_from_api(line, &mut ctx);
let snip = Snippet::new(line.first().expect("Empty line"), &line);
let(head,tail) = snip.pop_front().unwrap();
let name = if let GenTok::Name(n) = &head.tok { n } else { panic!("No line head") };
let name = if let GenTok::Name(n) = &head.tok {
n
}else {
panic!("No line head")
};
let parser = parsers.iter().find(|p|p.line_head()== **name).expect("No parser candidate");
let o_line = match parser.parse(*exported,comments,tail){
Err(e) => Err(e.to_api()),
Ok(t) => Ok(ttv_to_api(t, &mut |f,range|{
api::TokenTree{ range, token: api::Token::Atom(f.clone().build(ctx.clone())) }
api::TokenTree {
range,token:api::Token::Atom(f.clone().build(ctx.clone()))
}
})),
};
hand.handle(&pline, &o_line)
hand.handle(&pline, &o_line).await
}
api::HostExtReq::AtomReq(atom_req) => {
let atom = atom_req.get_atom();
with_atom_record(&mk_ctx, hand.reqnot(), atom, |nfo, ctx, id, buf| {
with_atom_record(&mk_ctx,hand.reqnot(),atom, |nfo,ctx,id,buf|async {
let actx = AtomCtx(buf,atom.drop,ctx.clone());
match&atom_req {
api::AtomReq::SerializeAtom(ser) => {
let mut buf = enc_vec(&id);
let refs_opt = nfo.serialize(actx, &mut buf);
hand.handle(ser, &refs_opt.map(|refs| (buf, refs)))
hand.handle(ser, &refs_opt.map(|refs|(buf,refs))),await
}
api::AtomReq::AtomPrint(print@api::AtomPrint(_)) =>
hand.handle(print, &nfo.print(actx)),
api::AtomReq::AtomPrint(print@api::AtomPrint(_)) => hand.handle(print, &nfo.print(actx)).await,
api::AtomReq::Fwded(fwded) => {
let api::Fwded(_,key,payload) = &fwded;
let mut reply = Vec::new();
let some = nfo.handle_req(actx,Sym::from_api(*key), &mut &payload[..], &mut reply);
hand.handle(fwded, &some.then_some(reply))
hand.handle(fwded, &some.then_some(reply)).await
}
api::AtomReq::CallRef(call@api::CallRef(_,arg)) => {
let ret = nfo.call_ref(actx, *arg);
hand.handle(call, &ret.api_return(ctx.clone(), &mut |h| hand.defer_drop(h)))
hand.handle(call, &ret.api_return(ctx.clone(), &mut |h|hand.defer_drop(h))).await
},
api::AtomReq::FinalCall(call@api::FinalCall(_,arg)) => {
let ret = nfo.call(actx, *arg);
hand.handle(call, &ret.api_return(ctx.clone(), &mut |h| hand.defer_drop(h)))
hand.handle(call, &ret.api_return(ctx.clone(), &mut |h|hand.defer_drop(h))).await
}
api::AtomReq::Command(cmd@api::Command(_)) => {
hand.handle(cmd, &match nfo.command(actx){
Err(e) => Err(e.to_api()),
Ok(opt) => Ok(match opt {
None => api::NextStep::Halt,
Some(cont) => api::NextStep::Continue(
cont.api_return(ctx.clone(), &mut |h| hand.defer_drop(h))
),
})
Some(cont) => api::NextStep::Continue(cont.api_return(ctx.clone(), &mut |h|hand.defer_drop(h))),
})
}).await
}
}
})
}).await
},
api::HostExtReq::DeserAtom(deser) => {
let api::DeserAtom(sys,buf,refs) = &deser;
@@ -277,29 +309,27 @@ fn extension_main_logic(data: ExtensionData) {
let id = api::AtomId::decode(&mut read);
let inst = ctx.cted.inst();
let nfo = atom_by_idx(inst.card(),id).expect("Deserializing atom with invalid ID");
hand.handle(&deser, &nfo.deserialize(ctx.clone(), read, refs))
hand.handle(&deser, &nfo.deserialize(ctx.clone(),read,refs)).await
},
orchid_api::HostExtReq::ApplyMacro(am) => {
let tok = hand.will_handle_as(&am);
let sys_ctx = mk_ctx(am.sys,hand.reqnot());
let ctx = RuleCtx {
args: (am.params.into_iter())
.map(|(k, v)| (
Tok::from_api(k),
mtreev_from_api(&v, &mut |_| panic!("No atom in macro prompt!"))
))
.collect(),
run_id: am.run_id,
sys: sys_ctx.clone(),
args:(am.params.into_iter()).map(|(k,v)|(Tok::from_api(k),mtreev_from_api(&v, &mut |_|panic!("No atom in macro prompt!")))).collect(),run_id:am.run_id,sys:sys_ctx.clone(),
};
hand.handle_as(tok, &match apply_rule(am.id,ctx){
Err(e) => e.keep_only(|e| *e!=err_cascade()).map(|e|Err(e.to_api())),
Ok(t) => Some(Ok(mtreev_to_api(&t, &mut |a|{
api::MacroToken::Atom(a.clone().build(sys_ctx.clone()))
}))),
})
}).await
}
}),
};
receipt
}.boxed_local())
},
);
init_replica(rn.clone().map());
while !exiting.load(Ordering::Relaxed) {

View File

@@ -0,0 +1,31 @@
thread 'main' panicked at /rust/deps/annotate-snippets-0.9.2/src/display_list/from_snippet.rs:275:9:
SourceAnnotation range `(100, 102)` is bigger than source length `101`
stack backtrace:
0: 0x7b98e2f6d725 - std::backtrace::Backtrace::create::hea54461184d28e5c
1: 0x7b98e14e0cb5 - std::backtrace::Backtrace::force_capture::h50ac56ebac4f2900
2: 0x7b98e065b0e0 - std[dd93a93a14cc3e06]::panicking::update_hook::<alloc[634825797b513591]::boxed::Box<rustc_driver_impl[c64f1141ed92455f]::install_ice_hook::{closure#1}>>::{closure#0}
3: 0x7b98e14f9623 - std::panicking::rust_panic_with_hook::hdfd8e9403702a2d1
4: 0x7b98e14f931a - std::panicking::begin_panic_handler::{{closure}}::h47998eb7cec3c619
5: 0x7b98e14f6ce9 - std::sys::backtrace::__rust_end_short_backtrace::h51610b4899330428
6: 0x7b98e14f8fdd - rust_begin_unwind
7: 0x7b98de1a6b10 - core::panicking::panic_fmt::h76c97b2053f3e171
8: 0x5a2f48927da0 - <annotate_snippets[7516fd2ac470cd96]::display_list::structs::DisplayList as core[369bcca9ba44f16b]::convert::From<annotate_snippets[7516fd2ac470cd96]::snippet::Snippet>>::from
9: 0x5a2f48753db4 - <rustfmt_nightly[fdba9bd7d028ddaf]::format_report_formatter::FormatReportFormatter as core[369bcca9ba44f16b]::fmt::Display>::fmt
10: 0x7b98e1c12d66 - core::fmt::write::hbdbaf54d653bfdc0
11: 0x7b98e14ea90e - <&std::io::stdio::Stderr as std::io::Write>::write_fmt::h297671288300128f
12: 0x7b98e14eb2d8 - std::io::stdio::_eprint::hc00582a539350b14
13: 0x5a2f4864df33 - rustfmt[d1e716a5735454ec]::format_and_emit_report::<std[dd93a93a14cc3e06]::io::stdio::Stdout>
14: 0x5a2f4864c99f - rustfmt[d1e716a5735454ec]::execute
15: 0x5a2f48647943 - rustfmt[d1e716a5735454ec]::main
16: 0x5a2f4863be73 - std[dd93a93a14cc3e06]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
17: 0x5a2f4863c3f9 - std[dd93a93a14cc3e06]::rt::lang_start::<()>::{closure#0}
18: 0x7b98e2a77ade - std::rt::lang_start_internal::h1d6a430fc18f5497
19: 0x5a2f4864ef98 - main
20: 0x7b98dce34e08 - <unknown>
21: 0x7b98dce34ecc - __libc_start_main
22: 0x5a2f4862f6c9 - <unknown>
23: 0x0 - <unknown>
rustc version: 1.86.0-nightly (419b3e2d3 2025-01-15)
platform: x86_64-unknown-linux-gnu

View File

@@ -0,0 +1,31 @@
thread 'main' panicked at /rust/deps/annotate-snippets-0.9.2/src/display_list/from_snippet.rs:275:9:
SourceAnnotation range `(100, 102)` is bigger than source length `101`
stack backtrace:
0: 0x7769ba36d725 - std::backtrace::Backtrace::create::hea54461184d28e5c
1: 0x7769b88e0cb5 - std::backtrace::Backtrace::force_capture::h50ac56ebac4f2900
2: 0x7769b7a5b0e0 - std[dd93a93a14cc3e06]::panicking::update_hook::<alloc[634825797b513591]::boxed::Box<rustc_driver_impl[c64f1141ed92455f]::install_ice_hook::{closure#1}>>::{closure#0}
3: 0x7769b88f9623 - std::panicking::rust_panic_with_hook::hdfd8e9403702a2d1
4: 0x7769b88f931a - std::panicking::begin_panic_handler::{{closure}}::h47998eb7cec3c619
5: 0x7769b88f6ce9 - std::sys::backtrace::__rust_end_short_backtrace::h51610b4899330428
6: 0x7769b88f8fdd - rust_begin_unwind
7: 0x7769b55a6b10 - core::panicking::panic_fmt::h76c97b2053f3e171
8: 0x5c922ea84da0 - <annotate_snippets[7516fd2ac470cd96]::display_list::structs::DisplayList as core[369bcca9ba44f16b]::convert::From<annotate_snippets[7516fd2ac470cd96]::snippet::Snippet>>::from
9: 0x5c922e8b0db4 - <rustfmt_nightly[fdba9bd7d028ddaf]::format_report_formatter::FormatReportFormatter as core[369bcca9ba44f16b]::fmt::Display>::fmt
10: 0x7769b9012d66 - core::fmt::write::hbdbaf54d653bfdc0
11: 0x7769b88ea90e - <&std::io::stdio::Stderr as std::io::Write>::write_fmt::h297671288300128f
12: 0x7769b88eb2d8 - std::io::stdio::_eprint::hc00582a539350b14
13: 0x5c922e7aaf33 - rustfmt[d1e716a5735454ec]::format_and_emit_report::<std[dd93a93a14cc3e06]::io::stdio::Stdout>
14: 0x5c922e7a999f - rustfmt[d1e716a5735454ec]::execute
15: 0x5c922e7a4943 - rustfmt[d1e716a5735454ec]::main
16: 0x5c922e798e73 - std[dd93a93a14cc3e06]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
17: 0x5c922e7993f9 - std[dd93a93a14cc3e06]::rt::lang_start::<()>::{closure#0}
18: 0x7769b9e77ade - std::rt::lang_start_internal::h1d6a430fc18f5497
19: 0x5c922e7abf98 - main
20: 0x7769b4145e08 - <unknown>
21: 0x7769b4145ecc - __libc_start_main
22: 0x5c922e78c6c9 - <unknown>
23: 0x0 - <unknown>
rustc version: 1.86.0-nightly (419b3e2d3 2025-01-15)
platform: x86_64-unknown-linux-gnu

View File

@@ -0,0 +1,31 @@
thread 'main' panicked at /rust/deps/annotate-snippets-0.9.2/src/display_list/from_snippet.rs:275:9:
SourceAnnotation range `(100, 102)` is bigger than source length `101`
stack backtrace:
0: 0x75c3f976d725 - std::backtrace::Backtrace::create::hea54461184d28e5c
1: 0x75c3f7ce0cb5 - std::backtrace::Backtrace::force_capture::h50ac56ebac4f2900
2: 0x75c3f6e5b0e0 - std[dd93a93a14cc3e06]::panicking::update_hook::<alloc[634825797b513591]::boxed::Box<rustc_driver_impl[c64f1141ed92455f]::install_ice_hook::{closure#1}>>::{closure#0}
3: 0x75c3f7cf9623 - std::panicking::rust_panic_with_hook::hdfd8e9403702a2d1
4: 0x75c3f7cf931a - std::panicking::begin_panic_handler::{{closure}}::h47998eb7cec3c619
5: 0x75c3f7cf6ce9 - std::sys::backtrace::__rust_end_short_backtrace::h51610b4899330428
6: 0x75c3f7cf8fdd - rust_begin_unwind
7: 0x75c3f49a6b10 - core::panicking::panic_fmt::h76c97b2053f3e171
8: 0x630acd2a0da0 - <annotate_snippets[7516fd2ac470cd96]::display_list::structs::DisplayList as core[369bcca9ba44f16b]::convert::From<annotate_snippets[7516fd2ac470cd96]::snippet::Snippet>>::from
9: 0x630acd0ccdb4 - <rustfmt_nightly[fdba9bd7d028ddaf]::format_report_formatter::FormatReportFormatter as core[369bcca9ba44f16b]::fmt::Display>::fmt
10: 0x75c3f8412d66 - core::fmt::write::hbdbaf54d653bfdc0
11: 0x75c3f7cea90e - <&std::io::stdio::Stderr as std::io::Write>::write_fmt::h297671288300128f
12: 0x75c3f7ceb2d8 - std::io::stdio::_eprint::hc00582a539350b14
13: 0x630accfc6f33 - rustfmt[d1e716a5735454ec]::format_and_emit_report::<std[dd93a93a14cc3e06]::io::stdio::Stdout>
14: 0x630accfc599f - rustfmt[d1e716a5735454ec]::execute
15: 0x630accfc0943 - rustfmt[d1e716a5735454ec]::main
16: 0x630accfb4e73 - std[dd93a93a14cc3e06]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
17: 0x630accfb53f9 - std[dd93a93a14cc3e06]::rt::lang_start::<()>::{closure#0}
18: 0x75c3f9277ade - std::rt::lang_start_internal::h1d6a430fc18f5497
19: 0x630accfc7f98 - main
20: 0x75c3f3634e08 - <unknown>
21: 0x75c3f3634ecc - __libc_start_main
22: 0x630accfa86c9 - <unknown>
23: 0x0 - <unknown>
rustc version: 1.86.0-nightly (419b3e2d3 2025-01-15)
platform: x86_64-unknown-linux-gnu

View File

@@ -0,0 +1,31 @@
thread 'main' panicked at /rust/deps/annotate-snippets-0.9.2/src/display_list/from_snippet.rs:275:9:
SourceAnnotation range `(100, 102)` is bigger than source length `101`
stack backtrace:
0: 0x76753116d725 - std::backtrace::Backtrace::create::hea54461184d28e5c
1: 0x76752f6e0cb5 - std::backtrace::Backtrace::force_capture::h50ac56ebac4f2900
2: 0x76752e85b0e0 - std[dd93a93a14cc3e06]::panicking::update_hook::<alloc[634825797b513591]::boxed::Box<rustc_driver_impl[c64f1141ed92455f]::install_ice_hook::{closure#1}>>::{closure#0}
3: 0x76752f6f9623 - std::panicking::rust_panic_with_hook::hdfd8e9403702a2d1
4: 0x76752f6f931a - std::panicking::begin_panic_handler::{{closure}}::h47998eb7cec3c619
5: 0x76752f6f6ce9 - std::sys::backtrace::__rust_end_short_backtrace::h51610b4899330428
6: 0x76752f6f8fdd - rust_begin_unwind
7: 0x76752c3a6b10 - core::panicking::panic_fmt::h76c97b2053f3e171
8: 0x5750f6273da0 - <annotate_snippets[7516fd2ac470cd96]::display_list::structs::DisplayList as core[369bcca9ba44f16b]::convert::From<annotate_snippets[7516fd2ac470cd96]::snippet::Snippet>>::from
9: 0x5750f609fdb4 - <rustfmt_nightly[fdba9bd7d028ddaf]::format_report_formatter::FormatReportFormatter as core[369bcca9ba44f16b]::fmt::Display>::fmt
10: 0x76752fe12d66 - core::fmt::write::hbdbaf54d653bfdc0
11: 0x76752f6ea90e - <&std::io::stdio::Stderr as std::io::Write>::write_fmt::h297671288300128f
12: 0x76752f6eb2d8 - std::io::stdio::_eprint::hc00582a539350b14
13: 0x5750f5f99f33 - rustfmt[d1e716a5735454ec]::format_and_emit_report::<std[dd93a93a14cc3e06]::io::stdio::Stdout>
14: 0x5750f5f9899f - rustfmt[d1e716a5735454ec]::execute
15: 0x5750f5f93943 - rustfmt[d1e716a5735454ec]::main
16: 0x5750f5f87e73 - std[dd93a93a14cc3e06]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
17: 0x5750f5f883f9 - std[dd93a93a14cc3e06]::rt::lang_start::<()>::{closure#0}
18: 0x767530c77ade - std::rt::lang_start_internal::h1d6a430fc18f5497
19: 0x5750f5f9af98 - main
20: 0x76752aef0e08 - <unknown>
21: 0x76752aef0ecc - __libc_start_main
22: 0x5750f5f7b6c9 - <unknown>
23: 0x0 - <unknown>
rustc version: 1.86.0-nightly (419b3e2d3 2025-01-15)
platform: x86_64-unknown-linux-gnu

View File

@@ -0,0 +1,31 @@
thread 'main' panicked at /rust/deps/annotate-snippets-0.9.2/src/display_list/from_snippet.rs:275:9:
SourceAnnotation range `(100, 102)` is bigger than source length `101`
stack backtrace:
0: 0x7fbe8296d725 - std::backtrace::Backtrace::create::hea54461184d28e5c
1: 0x7fbe80ee0cb5 - std::backtrace::Backtrace::force_capture::h50ac56ebac4f2900
2: 0x7fbe8005b0e0 - std[dd93a93a14cc3e06]::panicking::update_hook::<alloc[634825797b513591]::boxed::Box<rustc_driver_impl[c64f1141ed92455f]::install_ice_hook::{closure#1}>>::{closure#0}
3: 0x7fbe80ef9623 - std::panicking::rust_panic_with_hook::hdfd8e9403702a2d1
4: 0x7fbe80ef931a - std::panicking::begin_panic_handler::{{closure}}::h47998eb7cec3c619
5: 0x7fbe80ef6ce9 - std::sys::backtrace::__rust_end_short_backtrace::h51610b4899330428
6: 0x7fbe80ef8fdd - rust_begin_unwind
7: 0x7fbe7dba6b10 - core::panicking::panic_fmt::h76c97b2053f3e171
8: 0x645d8f426da0 - <annotate_snippets[7516fd2ac470cd96]::display_list::structs::DisplayList as core[369bcca9ba44f16b]::convert::From<annotate_snippets[7516fd2ac470cd96]::snippet::Snippet>>::from
9: 0x645d8f252db4 - <rustfmt_nightly[fdba9bd7d028ddaf]::format_report_formatter::FormatReportFormatter as core[369bcca9ba44f16b]::fmt::Display>::fmt
10: 0x7fbe81612d66 - core::fmt::write::hbdbaf54d653bfdc0
11: 0x7fbe80eea90e - <&std::io::stdio::Stderr as std::io::Write>::write_fmt::h297671288300128f
12: 0x7fbe80eeb2d8 - std::io::stdio::_eprint::hc00582a539350b14
13: 0x645d8f14cf33 - rustfmt[d1e716a5735454ec]::format_and_emit_report::<std[dd93a93a14cc3e06]::io::stdio::Stdout>
14: 0x645d8f14b99f - rustfmt[d1e716a5735454ec]::execute
15: 0x645d8f146943 - rustfmt[d1e716a5735454ec]::main
16: 0x645d8f13ae73 - std[dd93a93a14cc3e06]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
17: 0x645d8f13b3f9 - std[dd93a93a14cc3e06]::rt::lang_start::<()>::{closure#0}
18: 0x7fbe82477ade - std::rt::lang_start_internal::h1d6a430fc18f5497
19: 0x645d8f14df98 - main
20: 0x7fbe7c745e08 - <unknown>
21: 0x7fbe7c745ecc - __libc_start_main
22: 0x645d8f12e6c9 - <unknown>
23: 0x0 - <unknown>
rustc version: 1.86.0-nightly (419b3e2d3 2025-01-15)
platform: x86_64-unknown-linux-gnu

View File

@@ -0,0 +1,31 @@
thread 'main' panicked at /rust/deps/annotate-snippets-0.9.2/src/display_list/from_snippet.rs:275:9:
SourceAnnotation range `(100, 102)` is bigger than source length `101`
stack backtrace:
0: 0x7ae58e56d725 - std::backtrace::Backtrace::create::hea54461184d28e5c
1: 0x7ae58cae0cb5 - std::backtrace::Backtrace::force_capture::h50ac56ebac4f2900
2: 0x7ae58bc5b0e0 - std[dd93a93a14cc3e06]::panicking::update_hook::<alloc[634825797b513591]::boxed::Box<rustc_driver_impl[c64f1141ed92455f]::install_ice_hook::{closure#1}>>::{closure#0}
3: 0x7ae58caf9623 - std::panicking::rust_panic_with_hook::hdfd8e9403702a2d1
4: 0x7ae58caf931a - std::panicking::begin_panic_handler::{{closure}}::h47998eb7cec3c619
5: 0x7ae58caf6ce9 - std::sys::backtrace::__rust_end_short_backtrace::h51610b4899330428
6: 0x7ae58caf8fdd - rust_begin_unwind
7: 0x7ae5897a6b10 - core::panicking::panic_fmt::h76c97b2053f3e171
8: 0x59f3f1d86da0 - <annotate_snippets[7516fd2ac470cd96]::display_list::structs::DisplayList as core[369bcca9ba44f16b]::convert::From<annotate_snippets[7516fd2ac470cd96]::snippet::Snippet>>::from
9: 0x59f3f1bb2db4 - <rustfmt_nightly[fdba9bd7d028ddaf]::format_report_formatter::FormatReportFormatter as core[369bcca9ba44f16b]::fmt::Display>::fmt
10: 0x7ae58d212d66 - core::fmt::write::hbdbaf54d653bfdc0
11: 0x7ae58caea90e - <&std::io::stdio::Stderr as std::io::Write>::write_fmt::h297671288300128f
12: 0x7ae58caeb2d8 - std::io::stdio::_eprint::hc00582a539350b14
13: 0x59f3f1aacf33 - rustfmt[d1e716a5735454ec]::format_and_emit_report::<std[dd93a93a14cc3e06]::io::stdio::Stdout>
14: 0x59f3f1aab99f - rustfmt[d1e716a5735454ec]::execute
15: 0x59f3f1aa6943 - rustfmt[d1e716a5735454ec]::main
16: 0x59f3f1a9ae73 - std[dd93a93a14cc3e06]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
17: 0x59f3f1a9b3f9 - std[dd93a93a14cc3e06]::rt::lang_start::<()>::{closure#0}
18: 0x7ae58e077ade - std::rt::lang_start_internal::h1d6a430fc18f5497
19: 0x59f3f1aadf98 - main
20: 0x7ae588345e08 - <unknown>
21: 0x7ae588345ecc - __libc_start_main
22: 0x59f3f1a8e6c9 - <unknown>
23: 0x0 - <unknown>
rustc version: 1.86.0-nightly (419b3e2d3 2025-01-15)
platform: x86_64-unknown-linux-gnu

View File

@@ -0,0 +1,31 @@
thread 'main' panicked at /rust/deps/annotate-snippets-0.9.2/src/display_list/from_snippet.rs:275:9:
SourceAnnotation range `(100, 102)` is bigger than source length `101`
stack backtrace:
0: 0x7306aa96d725 - std::backtrace::Backtrace::create::hea54461184d28e5c
1: 0x7306a8ee0cb5 - std::backtrace::Backtrace::force_capture::h50ac56ebac4f2900
2: 0x7306a805b0e0 - std[dd93a93a14cc3e06]::panicking::update_hook::<alloc[634825797b513591]::boxed::Box<rustc_driver_impl[c64f1141ed92455f]::install_ice_hook::{closure#1}>>::{closure#0}
3: 0x7306a8ef9623 - std::panicking::rust_panic_with_hook::hdfd8e9403702a2d1
4: 0x7306a8ef931a - std::panicking::begin_panic_handler::{{closure}}::h47998eb7cec3c619
5: 0x7306a8ef6ce9 - std::sys::backtrace::__rust_end_short_backtrace::h51610b4899330428
6: 0x7306a8ef8fdd - rust_begin_unwind
7: 0x7306a5ba6b10 - core::panicking::panic_fmt::h76c97b2053f3e171
8: 0x646d10ca5da0 - <annotate_snippets[7516fd2ac470cd96]::display_list::structs::DisplayList as core[369bcca9ba44f16b]::convert::From<annotate_snippets[7516fd2ac470cd96]::snippet::Snippet>>::from
9: 0x646d10ad1db4 - <rustfmt_nightly[fdba9bd7d028ddaf]::format_report_formatter::FormatReportFormatter as core[369bcca9ba44f16b]::fmt::Display>::fmt
10: 0x7306a9612d66 - core::fmt::write::hbdbaf54d653bfdc0
11: 0x7306a8eea90e - <&std::io::stdio::Stderr as std::io::Write>::write_fmt::h297671288300128f
12: 0x7306a8eeb2d8 - std::io::stdio::_eprint::hc00582a539350b14
13: 0x646d109cbf33 - rustfmt[d1e716a5735454ec]::format_and_emit_report::<std[dd93a93a14cc3e06]::io::stdio::Stdout>
14: 0x646d109ca99f - rustfmt[d1e716a5735454ec]::execute
15: 0x646d109c5943 - rustfmt[d1e716a5735454ec]::main
16: 0x646d109b9e73 - std[dd93a93a14cc3e06]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
17: 0x646d109ba3f9 - std[dd93a93a14cc3e06]::rt::lang_start::<()>::{closure#0}
18: 0x7306aa477ade - std::rt::lang_start_internal::h1d6a430fc18f5497
19: 0x646d109ccf98 - main
20: 0x7306a4745e08 - <unknown>
21: 0x7306a4745ecc - __libc_start_main
22: 0x646d109ad6c9 - <unknown>
23: 0x0 - <unknown>
rustc version: 1.86.0-nightly (419b3e2d3 2025-01-15)
platform: x86_64-unknown-linux-gnu

View File

@@ -7,7 +7,7 @@ style_edition = "2024"
tab_spaces = 2
hard_tabs = true
max_width = 100
#error_on_line_overflow = true
error_on_line_overflow = true
error_on_unformatted = true
format_macro_matchers = true
newline_style = "Unix"