Skip to content

Commit

Permalink
Revert "Allow yeeting context selectors to generate errors"
Browse files Browse the repository at this point in the history
This reverts commit d826e6a.

We found type inference regressions in the lead up to 0.8. This
feature doesn't pull its weight yet and is easiest to revert for
now. When `yeet` moves along, we can revisit.

See #431
  • Loading branch information
shepmaster committed Dec 27, 2023
1 parent c1faaa8 commit 7b8e6a8
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 50 deletions.
4 changes: 0 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,6 @@ nightly_test_task:
- cd compatibility-tests/backtrace-provider-api/
- rustc --version
- cargo test
yeet_selectors_test_script:
- cd compatibility-tests/yeet-selectors/
- rustc --version
- cargo test
before_cache_script: rm -rf $CARGO_HOME/registry/index

# Our Minimal Supported Rust Version (MSRV)
Expand Down
9 changes: 0 additions & 9 deletions compatibility-tests/yeet-selectors/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion compatibility-tests/yeet-selectors/rust-toolchain

This file was deleted.

20 changes: 0 additions & 20 deletions compatibility-tests/yeet-selectors/src/lib.rs

This file was deleted.

10 changes: 0 additions & 10 deletions snafu-derive/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,6 @@ pub mod context_selector {
::core::result::Result::Err(self.build())
}
}

impl<#(#original_generics_without_defaults,)* #(#user_field_generics,)*> ::core::convert::From<#parameterized_selector_name> for #parameterized_error_name
where
#(#extended_where_clauses),*
{
#[track_caller]
fn from(other: #parameterized_selector_name) -> Self {
other.build()
}
}
}
}

Expand Down
6 changes: 0 additions & 6 deletions tests/build-leaf-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,3 @@ fn implements_error() {

map_result().unwrap_err();
}

#[test]
fn build_via_from_and_into() {
let _e = Error::from(MineSnafu);
let _e: Error = MineSnafu.into();
}

0 comments on commit 7b8e6a8

Please sign in to comment.