diff --git a/Cargo.toml b/Cargo.toml
index 7bd1c9bf4..4da467184 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,6 +11,7 @@ description = """
Sentry (getsentry.com) client for rust ;)
"""
build = "build.rs"
+edition = "2018"
autoexamples = true
[package.metadata.docs.rs]
diff --git a/README.md b/README.md
index 04dab9eb8..9cfcb1735 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,8 @@ We currently only verify this crate against a recent version of Sentry hosted on
[sentry.io](https://sentry.io/) but it should work with on-prem Sentry versions
8.20 and later.
+Additionally, the lowest Rust version we target is _1.31.0_.
+
## Resources
- [crates.io](https://crates.io/crates/sentry)
diff --git a/build.rs b/build.rs
index 0de9b1de4..5a176cedf 100644
--- a/build.rs
+++ b/build.rs
@@ -1,6 +1,3 @@
-#[cfg(feature = "with_rust_info")]
-extern crate rustc_version;
-
use std::env;
use std::fs::File;
use std::io::Write;
diff --git a/examples/before-send.rs b/examples/before-send.rs
index 779129132..94c498f09 100644
--- a/examples/before-send.rs
+++ b/examples/before-send.rs
@@ -1,5 +1,3 @@
-extern crate sentry;
-
use std::sync::Arc;
fn main() {
diff --git a/examples/error-chain-demo.rs b/examples/error-chain-demo.rs
index 49e0ef0ea..e2803db06 100644
--- a/examples/error-chain-demo.rs
+++ b/examples/error-chain-demo.rs
@@ -1,7 +1,5 @@
#[macro_use]
extern crate error_chain;
-#[macro_use]
-extern crate sentry;
use sentry::integrations::error_chain::capture_error_chain;
@@ -25,7 +23,7 @@ fn main() {
.parse()
.unwrap(),
),
- release: sentry_crate_release!(),
+ release: sentry::release_name!(),
..Default::default()
});
diff --git a/examples/event-processors.rs b/examples/event-processors.rs
index b1b4698dd..178f452ab 100644
--- a/examples/event-processors.rs
+++ b/examples/event-processors.rs
@@ -1,5 +1,3 @@
-extern crate sentry;
-
fn main() {
let client =
sentry::Client::from_config("https://a94ae32be2584e0bbd7a4cbb95971fee@sentry.io/1041156");
diff --git a/examples/failure-demo.rs b/examples/failure-demo.rs
index ea57b28d1..9e5f0bb51 100644
--- a/examples/failure-demo.rs
+++ b/examples/failure-demo.rs
@@ -1,9 +1,4 @@
-extern crate failure;
-#[macro_use]
-extern crate failure_derive;
-#[macro_use]
-extern crate sentry;
-
+use failure::Fail;
use sentry::integrations::failure::capture_error;
#[derive(Fail, Debug)]
@@ -25,7 +20,7 @@ fn main() {
let _sentry = sentry::init((
"https://a94ae32be2584e0bbd7a4cbb95971fee@sentry.io/1041156",
sentry::ClientOptions {
- release: sentry_crate_release!(),
+ release: sentry::release_name!(),
..Default::default()
},
));
diff --git a/examples/init-with-client.rs b/examples/init-with-client.rs
index f5b205f40..793a86fde 100644
--- a/examples/init-with-client.rs
+++ b/examples/init-with-client.rs
@@ -1,5 +1,3 @@
-extern crate sentry;
-
fn main() {
let client =
sentry::Client::from_config("https://a94ae32be2584e0bbd7a4cbb95971fee@sentry.io/1041156");
diff --git a/examples/log-demo.rs b/examples/log-demo.rs
index 8dd2bccc1..19d32384b 100644
--- a/examples/log-demo.rs
+++ b/examples/log-demo.rs
@@ -1,15 +1,10 @@
-extern crate log;
-extern crate pretty_env_logger;
-extern crate sentry;
-
use log::{debug, error, info, warn};
-use sentry::sentry_crate_release;
fn main() {
let _sentry = sentry::init((
"https://a94ae32be2584e0bbd7a4cbb95971fee@sentry.io/1041156",
sentry::ClientOptions {
- release: sentry_crate_release!(),
+ release: sentry::release_name!(),
..Default::default()
},
));
diff --git a/examples/message-demo.rs b/examples/message-demo.rs
index 7cfcd4577..79a827b93 100644
--- a/examples/message-demo.rs
+++ b/examples/message-demo.rs
@@ -1,5 +1,3 @@
-extern crate sentry;
-
fn main() {
let _sentry = sentry::init("https://a94ae32be2584e0bbd7a4cbb95971fee@sentry.io/1041156");
sentry::configure_scope(|scope| {
diff --git a/examples/panic-demo.rs b/examples/panic-demo.rs
index 484a01b87..f20170e90 100644
--- a/examples/panic-demo.rs
+++ b/examples/panic-demo.rs
@@ -1,11 +1,8 @@
-#[macro_use]
-extern crate sentry;
-
fn main() {
let _sentry = sentry::init((
"https://a94ae32be2584e0bbd7a4cbb95971fee@sentry.io/1041156",
sentry::ClientOptions {
- release: sentry_crate_release!(),
+ release: sentry::release_name!(),
..Default::default()
},
));
diff --git a/examples/send-with-extra.rs b/examples/send-with-extra.rs
index 83f1ff4e9..4fb0b4eec 100644
--- a/examples/send-with-extra.rs
+++ b/examples/send-with-extra.rs
@@ -1,5 +1,3 @@
-extern crate sentry;
-
fn main() {
let _sentry = sentry::init("https://a94ae32be2584e0bbd7a4cbb95971fee@sentry.io/1041156");
diff --git a/examples/thread-demo.rs b/examples/thread-demo.rs
index ab7e2c9ef..df2e4a5cb 100644
--- a/examples/thread-demo.rs
+++ b/examples/thread-demo.rs
@@ -1,9 +1,3 @@
-#[macro_use]
-extern crate log;
-extern crate pretty_env_logger;
-#[macro_use]
-extern crate sentry;
-
use std::sync::Arc;
use std::thread;
@@ -14,7 +8,7 @@ fn main() {
let _sentry = sentry::init((
"https://a94ae32be2584e0bbd7a4cbb95971fee@sentry.io/1041156",
sentry::ClientOptions {
- release: sentry_crate_release!(),
+ release: sentry::release_name!(),
..Default::default()
},
));
@@ -25,12 +19,12 @@ fn main() {
sentry::integrations::panic::register_panic_handler();
// the log integration sends to Hub::current()
- info!("Spawning thread");
+ log::info!("Spawning thread");
thread::spawn(|| {
// The thread spawned here gets a new hub cloned from the hub of the
// main thread.
- info!("Spawned thread, configuring scope.");
+ log::info!("Spawned thread, configuring scope.");
// now we want to create a new hub based on the thread's normal hub for
// working with it explicitly.
@@ -47,7 +41,7 @@ fn main() {
sentry::Hub::run(hub, || {
// the log integration picks up the Hub::current which is now bound
// to the outer hub.
- error!("Failing!");
+ log::error!("Failing!");
});
})
.join()
diff --git a/integrations/sentry-actix/Cargo.toml b/integrations/sentry-actix/Cargo.toml
index 0f1abdcdb..536c06ad8 100644
--- a/integrations/sentry-actix/Cargo.toml
+++ b/integrations/sentry-actix/Cargo.toml
@@ -10,6 +10,7 @@ documentation = "https://docs.rs/sentry-actix"
description = """
Sentry client extension for actix-web
"""
+edition = "2018"
[dependencies]
actix-web = { version = "0.7", default-features = false }
diff --git a/integrations/sentry-actix/examples/basic.rs b/integrations/sentry-actix/examples/basic.rs
index 8cb6b3203..44758138d 100644
--- a/integrations/sentry-actix/examples/basic.rs
+++ b/integrations/sentry-actix/examples/basic.rs
@@ -1,7 +1,3 @@
-extern crate actix_web;
-extern crate sentry;
-extern crate sentry_actix;
-
use std::env;
use std::io;
diff --git a/integrations/sentry-actix/src/lib.rs b/integrations/sentry-actix/src/lib.rs
index c84124304..3d32ff14a 100644
--- a/integrations/sentry-actix/src/lib.rs
+++ b/integrations/sentry-actix/src/lib.rs
@@ -74,10 +74,6 @@
//! });
//! # }
//! ```
-extern crate actix_web;
-extern crate failure;
-extern crate fragile;
-extern crate sentry;
use std::borrow::Cow;
use std::cell::RefCell;
@@ -326,7 +322,7 @@ impl ActixWebHubExt for Hub {
fn capture_actix_error(&self, err: &Error) -> Uuid {
let mut exceptions = vec![];
- let mut ptr: Option<&Fail> = Some(err.as_fail());
+ let mut ptr: Option<&dyn Fail> = Some(err.as_fail());
let mut idx = 0;
while let Some(fail) = ptr {
// Check whether the failure::Fail held by err is a failure::Error wrapped in Compat
diff --git a/src/backtrace_support.rs b/src/backtrace_support.rs
index e0068b258..9bbff9c4d 100644
--- a/src/backtrace_support.rs
+++ b/src/backtrace_support.rs
@@ -5,7 +5,7 @@ use regex::{Captures, Regex};
use crate::protocol::{Frame, Stacktrace};
-lazy_static! {
+lazy_static::lazy_static! {
static ref HASH_FUNC_RE: Regex = Regex::new(r#"(?x)
^(.*)::h[a-f0-9]{16}$
"#).unwrap();
@@ -27,6 +27,7 @@ pub static ref WELL_KNOWN_SYS_MODULES: Vec<&'static str> = {
}
rv
};
+
pub static ref WELL_KNOWN_BORDER_FRAMES: Vec<&'static str> = {
#[allow(unused_mut)]
let mut rv = vec![
@@ -44,6 +45,7 @@ pub static ref WELL_KNOWN_BORDER_FRAMES: Vec<&'static str> = {
}
rv
};
+
pub static ref SECONDARY_BORDER_FRAMES: Vec<(&'static str, &'static str)> = {
#![allow(unused_mut)]
let mut rv = Vec::new();
@@ -74,7 +76,7 @@ pub fn strip_symbol(s: &str) -> &str {
pub fn demangle_symbol(s: &str) -> String {
COMMON_RUST_SYMBOL_ESCAPES_RE
- .replace_all(s, |caps: &Captures| {
+ .replace_all(s, |caps: &Captures<'_>| {
match &caps[1] {
"SP" => "@",
"BP" => "*",
diff --git a/src/client.rs b/src/client.rs
index fe9518ffa..dd2442401 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -21,11 +21,11 @@ use crate::utils;
/// The Sentry client object.
pub struct Client {
options: ClientOptions,
- transport: RwLock