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

Add test of r#Backtrace that is not std::backtrace::Backtrace #351

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Nov 4, 2024

Without r#Backtrace:

error[E0308]: mismatched types
   --> tests/test_backtrace.rs:42:14
    |
42  |     #[derive(Error, Debug)]
    |              ^^^^^
    |              |
    |              expected `std::backtrace::Backtrace`, found `not_backtrace::Backtrace`
    |              arguments to this method are incorrect
    |
    = note: `not_backtrace::Backtrace` and `std::backtrace::Backtrace` have similar names, but are actually distinct types
note: `not_backtrace::Backtrace` is defined in the current crate
   --> tests/test_backtrace.rs:26:9
    |
26  |         pub struct Backtrace;
    |         ^^^^^^^^^^^^^^^^^^^^
note: `std::backtrace::Backtrace` is defined in crate `std`
   --> $RUSTUP_HOME/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/backtrace.rs:108:1
    |
108 | pub struct Backtrace {
    | ^^^^^^^^^^^^^^^^^^^^
note: method defined here
   --> $RUSTUP_HOME/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/error.rs:607:12
    |
607 |     pub fn provide_ref<T: ?Sized + 'static>(&mut self, value: &'a T) -> &mut Self {
    |            ^^^^^^^^^^^
    = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

Without r#Backtrace:

    error[E0308]: mismatched types
       --> tests/test_backtrace.rs:42:14
        |
    42  |     #[derive(Error, Debug)]
        |              ^^^^^
        |              |
        |              expected `std::backtrace::Backtrace`, found `not_backtrace::Backtrace`
        |              arguments to this method are incorrect
        |
        = note: `not_backtrace::Backtrace` and `std::backtrace::Backtrace` have similar names, but are actually distinct types
    note: `not_backtrace::Backtrace` is defined in the current crate
       --> tests/test_backtrace.rs:26:9
        |
    26  |         pub struct Backtrace;
        |         ^^^^^^^^^^^^^^^^^^^^
    note: `std::backtrace::Backtrace` is defined in crate `std`
       --> $RUSTUP_HOME/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/backtrace.rs:108:1
        |
    108 | pub struct Backtrace {
        | ^^^^^^^^^^^^^^^^^^^^
    note: method defined here
       --> $RUSTUP_HOME/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/error.rs:607:12
        |
    607 |     pub fn provide_ref<T: ?Sized + 'static>(&mut self, value: &'a T) -> &mut Self {
        |            ^^^^^^^^^^^
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)
@dtolnay dtolnay merged commit 3d23842 into master Nov 4, 2024
22 checks passed
@dtolnay dtolnay deleted the rawbacktrace branch November 4, 2024 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant