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

chore: upgrade to Rust 1.65 #1441

Merged
merged 2 commits into from
Nov 18, 2022
Merged

chore: upgrade to Rust 1.65 #1441

merged 2 commits into from
Nov 18, 2022

Conversation

ethowitz
Copy link
Contributor

No description provided.

@ethowitz ethowitz requested review from pjenvey and jrconlin November 18, 2022 16:09
@@ -19,7 +19,7 @@ pub struct TokenserverError {
/// For internal use only. Used to report any additional context behind an error to
/// distinguish between similar errors in Sentry.
pub context: String,
pub backtrace: Backtrace,
pub backtrace: Box<Backtrace>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The result_large_err clippy lint was saying that TokenserverError was too large. Boxing the backtrace field resolved the issue, but I don't quite understand why. This is the definition of Backtrace:

pub struct Backtrace {
    // Frames here are listed from top-to-bottom of the stack
    frames: Vec<BacktraceFrame>,
    // The index we believe is the actual start of the backtrace, omitting
    // frames like `Backtrace::new` and `backtrace::trace`.
    actual_start_index: usize,
}

Vecs are stored on the heap and usizes are trivially small, so 🤷🏻 it doesn't seem that big to me

Copy link
Member

Choose a reason for hiding this comment

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

It's because its large-error-threshold is quite small, defaulting to 128.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I should have read through the rest of the lint's documentation

@ethowitz ethowitz merged commit b95e549 into master Nov 18, 2022
@ethowitz ethowitz deleted the upgrade-to-rust-1.65 branch November 18, 2022 22:25
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.

2 participants