You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if i remove the sentry_layer in one of the two branches, it works. but with the code above the compile fails with an odd error:
error[E0277]: the trait bound `SentryLayer<Layered<json_subscriber::fmt::Layer, Registry>>: __tracing_subscriber_Layer<Layered<tracing_subscriber::fmt::Layer<Registry>, Registry>>` is not satisfied
--> crates/libpk/src/lib.rs:39:19
|
39 | .with(sentry_layer)
| ---- ^^^^^^^^^^^^ the trait `__tracing_subscriber_Layer<Layered<tracing_subscriber::fmt::Layer<Registry>, Registry>>` is not implemented for `SentryLayer<Layered<json_subscriber::fmt::Layer, Registry>>`
| |
| required by a bound introduced by this call
|
= help: the trait `Layer<Layered<tracing_subscriber::fmt::Layer<Registry>, _>>` is not implemented for `SentryLayer<Layered<json_subscriber::fmt::Layer, Registry>>`
but trait `Layer<Layered<json_subscriber::fmt::Layer, _>>` is implemented for it
= help: for that trait implementation, expected `json_subscriber::fmt::Layer`, found `tracing_subscriber::fmt::Layer<Registry>`
note: required by a bound in `with`
--> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-subscriber-0.3.18/src/layer/mod.rs:1503:12
|
1501 | fn with<L>(self, layer: L) -> Layered<L, Self>
| ---- required by a bound in this associated function
1502 | where
1503 | L: Layer<Self>,
| ^^^^^^^^^^^ required by this bound in `__tracing_subscriber_SubscriberExt::with`
error[E0599]: the method `init` exists for struct `Layered<SentryLayer<Layered<Layer, Registry>>, Layered<Layer<Registry>, Registry>>`, but its trait bounds were not satisfied
--> crates/libpk/src/lib.rs:40:14
|
37 | / tracing_subscriber::registry()
38 | | .with(tracing_subscriber::fmt::layer())
39 | | .with(sentry_layer)
40 | | .init();
| | -^^^^ method cannot be called due to unsatisfied trait bounds
| |_____________|
|
|
::: /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-subscriber-0.3.18/src/layer/layered.rs:22:1
|
22 | pub struct Layered<L, I, S = I> {
| ------------------------------- doesn't satisfy `_: Into<Dispatch>` or `_: SubscriberInitExt`
|
= note: the following trait bounds were not satisfied:
`Layered<SentryLayer<Layered<json_subscriber::fmt::Layer, Registry>>, Layered<tracing_subscriber::fmt::Layer<Registry>, Registry>>: Into<tracing::Dispatch>`
which is required by `Layered<SentryLayer<Layered<json_subscriber::fmt::Layer, Registry>>, Layered<tracing_subscriber::fmt::Layer<Registry>, Registry>>: SubscriberInitExt`
`&Layered<SentryLayer<Layered<json_subscriber::fmt::Layer, Registry>>, Layered<tracing_subscriber::fmt::Layer<Registry>, Registry>>: Into<tracing::Dispatch>`
which is required by `&Layered<SentryLayer<Layered<json_subscriber::fmt::Layer, Registry>>, Layered<tracing_subscriber::fmt::Layer<Registry>, Registry>>: SubscriberInitExt`
`&mut Layered<SentryLayer<Layered<json_subscriber::fmt::Layer, Registry>>, Layered<tracing_subscriber::fmt::Layer<Registry>, Registry>>: Into<tracing::Dispatch>`
which is required by `&mut Layered<SentryLayer<Layered<json_subscriber::fmt::Layer, Registry>>, Layered<tracing_subscriber::fmt::Layer<Registry>, Registry>>: SubscriberInitExt`
what is the correct way of doing this?
The text was updated successfully, but these errors were encountered:
Nice!
I'll keep this open so that I remember to look into it again.
I'm not sure if this behaviour is intended or if we're maybe missing some impls on SentryLayer that should be there so that it can be applied in whatever order.
i have a function such as this:
if i remove the
sentry_layer
in one of the two branches, it works. but with the code above the compile fails with an odd error:what is the correct way of doing this?
The text was updated successfully, but these errors were encountered: