Skip to content

Instantly share code, notes, and snippets.

@Akanoa
Last active August 21, 2022 19:17
Show Gist options
  • Save Akanoa/c188b59e50d839f8c4cc76ca97fa6263 to your computer and use it in GitHub Desktop.
Save Akanoa/c188b59e50d839f8c4cc76ca97fa6263 to your computer and use it in GitHub Desktop.
Panic on datastore new
[package]
name = "surreal"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
surrealdb = {version = "1.0.0-beta.6", default-features = false, features=["parallel", "scripting", "http", "kv-echodb"]}
eyre = "0.6.8"
tokio = {version = "1.20.1", features = ["rt-multi-thread", "macros"]}
RUST_BACKTRACE=1 cargo run
warning: unused variable: `datastore`
--> src/main.rs:9:9
|
9 | let datastore = Datastore::new("file://database.db").await?;
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_datastore`
|
= note: `#[warn(unused_variables)]` on by default
warning: `surreal` (bin "surreal") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 3.95s
Running `target/debug/surreal`
thread 'main' panicked at 'internal error: entered unreachable code', /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/surrealdb-1.0.0-beta.6/src/kvs/ds.rs:118:
18
stack backtrace:
0: rust_begin_unwind
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
2: core::panicking::panic
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:48:5
3: surrealdb::kvs::ds::Datastore::new::{{closure}}
at /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/surrealdb-1.0.0-beta.6/src/kvs/ds.rs:118:9
4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/future/mod.rs:91:19
5: surreal::run::{{closure}}
at ./src/main.rs:9:57
6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/future/mod.rs:91:19
7: surreal::main::{{closure}}
at ./src/main.rs:5:10
8: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/future/mod.rs:91:19
9: tokio::park::thread::CachedParkThread::block_on::{{closure}}
at /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/park/thread.rs:263:54
10: tokio::coop::with_budget::{{closure}}
at /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/coop.rs:102:9
11: std::thread::local::LocalKey<T>::try_with
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/thread/local.rs:445:16
12: std::thread::local::LocalKey<T>::with
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/thread/local.rs:421:9
13: tokio::coop::with_budget
at /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/coop.rs:95:5
14: tokio::coop::budget
at /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/coop.rs:72:5
15: tokio::park::thread::CachedParkThread::block_on
at /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/park/thread.rs:263:31
16: tokio::runtime::enter::Enter::block_on
at /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/enter.rs:152:13
17: tokio::runtime::thread_pool::ThreadPool::block_on
at /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/thread_pool/mod.rs:90:9
18: tokio::runtime::Runtime::block_on
at /home/noa/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.1/src/runtime/mod.rs:484:43
19: surreal::main
at ./src/main.rs:5:5
20: core::ops::function::FnOnce::call_once
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
use surrealdb::Datastore;
#[tokio::main]
async fn main() {
run().await.expect("");
}
async fn run() -> eyre::Result<()> {
let datastore = Datastore::new("file://database.db").await?;
Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment