Skip to content

Commit

Permalink
Cleanup internals (#101)
Browse files Browse the repository at this point in the history
* fix: const_err is not a hard error

See: rust-lang/rust#71800

* fix: lints

* fix: macro doctests

* fix: renamed lint

* fix: restore use of enum variant
  • Loading branch information
ten3roberts authored Aug 16, 2023
1 parent ee2077e commit 2d984da
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ thiserror = "1.0"
trybuild = { version = "1.0.19", features = ["diff"] }
backtrace = "0.3.46"
anyhow = "1.0.28"
syn = { version = "1.0", features = ["full"] }
syn = { version = "2.0", features = ["full"] }
pyo3 = { version = "0.13", default-features = false, features = ["auto-initialize"] }

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@
#![warn(
missing_debug_implementations,
missing_docs,
missing_doc_code_examples,
// FIXME: this lint is currently nightly only
rustdoc::missing_doc_code_examples,
rust_2018_idioms,
unreachable_pub,
bad_style,
const_err,
dead_code,
improper_ctypes,
non_shorthand_field_patterns,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ macro_rules! context_type {
#[derive(Debug)]
struct $name {
message: &'static str,
drop: DetectDrop,
_drop: DetectDrop,
}

impl Display for $name {
Expand Down Expand Up @@ -74,15 +74,15 @@ fn make_chain() -> (Report, Dropped) {
let mid = Err::<(), LowLevel>(low)
.wrap_err(MidLevel {
message: "failed to load config",
drop: DetectDrop::new(&dropped.mid),
_drop: DetectDrop::new(&dropped.mid),
})
.unwrap_err();

// impl Report for Result<T, Error>
let high = Err::<(), Report>(mid)
.wrap_err(HighLevel {
message: "failed to start server",
drop: DetectDrop::new(&dropped.high),
_drop: DetectDrop::new(&dropped.high),
})
.unwrap_err();

Expand Down
4 changes: 2 additions & 2 deletions tests/test_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ fn test_temporaries() {
// time it's done evaluating, those will stick around until the
// semicolon, which is on the other side of the await point, making the
// enclosing future non-Send.
Ready(Some(eyre!("..."))).await;
let _ = Ready(Some(eyre!("..."))).await;
});

fn message(cell: Cell<&str>) -> &str {
cell.get()
}

require_send_sync(async {
Ready(Some(eyre!(message(Cell::new("..."))))).await;
let _ = Ready(Some(eyre!(message(Cell::new("..."))))).await;
});
}

Expand Down

0 comments on commit 2d984da

Please sign in to comment.