-
Notifications
You must be signed in to change notification settings - Fork 1.7k
new_ret_no_self: allow Self in inner type for impl Trait return types #4365
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
Changes from 1 commit
d7b9a84
4fbe9f6
1d2c23a
54efffc
d553158
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -23,10 +23,13 @@ use std::collections::BTreeMap; | |||||
use std::collections::HashMap; | ||||||
use std::collections::HashSet; | ||||||
use std::collections::VecDeque; | ||||||
use std::future::Future; | ||||||
use std::iter::FromIterator; | ||||||
use std::ops::Mul; | ||||||
use std::pin::Pin; | ||||||
use std::rc::{self, Rc}; | ||||||
use std::sync::{self, Arc}; | ||||||
use std::task::{Context, Poll}; | ||||||
|
||||||
use option_helpers::IteratorFalsePositives; | ||||||
|
||||||
|
@@ -138,6 +141,21 @@ impl<T> V<T> { | |||||
} | ||||||
} | ||||||
|
||||||
struct AsyncNew; | ||||||
|
||||||
impl AsyncNew { | ||||||
fn new() -> impl Future<Output = Option<Self>> { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just make this function Everything else LGTM. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the tests seem to use Rust 2015 (which does not have async fns) and I don't know how to change that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, this again 😄 You have to add rust-clippy/tests/ui/issue_4266.rs Lines 1 to 2 in d71e9c4
at the top of the test case. We should document this. |
||||||
struct F; | ||||||
impl Future for F { | ||||||
type Output = Option<AsyncNew>; | ||||||
fn poll(self: Pin<&mut Self>, _cx: &mut Context) -> Poll<Self::Output> { | ||||||
unimplemented!() | ||||||
} | ||||||
} | ||||||
F | ||||||
} | ||||||
} | ||||||
|
||||||
impl Mul<T> for T { | ||||||
type Output = T; | ||||||
// No error, obviously. | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These imports are now unused.