Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup internals #101

Merged
merged 5 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what caused the failure of the src/macros.rs

The two versions of syn were conflicting with thiserror

pyo3 = { version = "0.13", default-features = false, features = ["auto-initialize"] }

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,13 @@
//! [`color-spantrace`]: https://github.com/yaahc/color-spantrace
//! [`color-backtrace`]: https://github.com/athre0z/color-backtrace
#![doc(html_root_url = "https://docs.rs/eyre/0.6.8")]
#![warn(

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --features auto-install)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --features pyo3)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --all-features)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --no-default-features)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --features track-caller)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --all-features)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --features track-caller)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --no-default-features)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --all-features)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --features auto-install)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --features pyo3)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --features auto-install)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --features track-caller)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --features pyo3)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --no-default-features)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (ubuntu-latest)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (windows-latest)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 332 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (macOS-latest)

unknown lint: `rustdoc::missing_doc_code_examples`
missing_debug_implementations,
missing_docs,
missing_doc_code_examples,

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --features auto-install)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --features pyo3)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --all-features)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --no-default-features)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (beta, --features track-caller)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --all-features)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --features track-caller)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --no-default-features)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --all-features)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --features auto-install)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (nightly, --features pyo3)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --features auto-install)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --features track-caller)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --features pyo3)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (stable, --no-default-features)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (ubuntu-latest)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (windows-latest)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`

Check warning on line 335 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Suite (macOS-latest)

lint `missing_doc_code_examples` has been renamed to `rustdoc::missing_doc_code_examples`
rust_2018_idioms,
unreachable_pub,
bad_style,
const_err,
dead_code,
improper_ctypes,
non_shorthand_field_patterns,
Expand Down
1 change: 0 additions & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
///
/// # fn main() -> Result<()> {
/// # let depth = 0;
/// # let err: &'static dyn std::error::Error = &ScienceError::RecursionLimitExceeded;
Copy link
Collaborator

@yaahc yaahc Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at this for a minute trying to figure out why it was there... honestly still not really sure. I'm guessing it has something to do with asserting that ScienceError type implements error, but the bail! macro should do the same thing, sooooo.... Seems fine

edit: seeing you already restored, kinda curious if you figured out why it was necessary.

/// #
/// if depth > MAX_DEPTH {
/// bail!(ScienceError::RecursionLimitExceeded);
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
Loading