Skip to content

build: migrate the codebase to the 2024 Language Edition #4191

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

Merged
merged 6 commits into from
Feb 23, 2025
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/cli/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{process::Process, utils::notify::NotificationLevel};
pub fn tracing_subscriber(
process: &Process,
) -> (
impl tracing::Subscriber,
impl tracing::Subscriber + use<>,
reload::Handle<EnvFilter, Registry>,
) {
#[cfg(feature = "otel")]
Expand All @@ -45,7 +45,7 @@ pub fn tracing_subscriber(
/// When the `RUSTUP_LOG` environment variable is present, a standard [`tracing_subscriber`]
/// formatter will be used according to the filtering directives set in its value.
/// Otherwise, this logger will use [`EventFormatter`] to mimic "classic" Rustup `stderr` output.
fn console_logger<S>(process: &Process) -> (impl Layer<S>, reload::Handle<EnvFilter, S>)
fn console_logger<S>(process: &Process) -> (impl Layer<S> + use<S>, reload::Handle<EnvFilter, S>)
where
S: Subscriber + for<'span> LookupSpan<'span>,
{
Expand Down Expand Up @@ -129,7 +129,7 @@ impl NotificationLevel {
/// A [`tracing::Subscriber`] [`Layer`][`tracing_subscriber::Layer`] that corresponds to Rustup's
/// optional `opentelemetry` (a.k.a. `otel`) feature.
#[cfg(feature = "otel")]
fn telemetry<S>(process: &Process) -> impl Layer<S>
fn telemetry<S>(process: &Process) -> impl Layer<S> + use<S>
Copy link
Member Author

@rami3l rami3l Feb 22, 2025

Choose a reason for hiding this comment

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

@djc So basically impl Layer<S> + use<S> means "this impl Layer<S> has nothing to do with 'process" (this function is generic over both 'process and S, so we use<S> to exclude 'process), and the same thing goes for other fixes in this commit.

where
S: Subscriber + for<'span> LookupSpan<'span>,
{
Expand Down