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

Return early if the method is a default trait impl for boxed_local #4833

Closed
wants to merge 3 commits into from
Closed
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
9 changes: 9 additions & 0 deletions tests/ui/escape_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ impl<T> MyTrait for Box<T> {
fn do_sth(self) {}
}

/// Fix for #4804
///
/// This shouldn't warn for `boxed_local` as traits don't have a know size in compile time
trait DefaultTraitImplTest {
fn default_impl(self: Box<Self>) -> u32 {
5
}
}
Comment on lines +160 to +164
Copy link
Author

Choose a reason for hiding this comment

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

Is this enough to cover this fix? There might be some more niche cases which I hadn't encountered but which should be tested as well.


// Issue #3739 - capture in closures
mod issue_3739 {
use super::A;
Expand Down