diff options
| author | bors <bors@rust-lang.org> | 2022-07-18 12:29:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-07-18 12:29:22 +0000 |
| commit | bf70865cf41459ffcb6c2328ac2c27b2f8c96ae6 (patch) | |
| tree | 7b5884f83106de6902551650da3c026d75263502 /tests | |
| parent | f4c9183531db5e78ab02caacdfd8a5312f6369a4 (diff) | |
| parent | 7a5965b459ecbaa3ca702ebb9ae31b89ef449528 (diff) | |
| download | rust-bf70865cf41459ffcb6c2328ac2c27b2f8c96ae6.tar.gz rust-bf70865cf41459ffcb6c2328ac2c27b2f8c96ae6.zip | |
Auto merge of #9199 - Xiretza:unused-self-exported-api, r=Jarcho
unused_self: respect avoid-breaking-exported-api ``` changelog: [`unused_self`]: Now respects the `avoid-breaking-exported-api` config option ``` Fixes #9195. I mostly copied the implementation from `unnecessary_wraps`, since I don't have much understanding of rustc internals.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/unused_self.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/unused_self.rs b/tests/ui/unused_self.rs index 08bf58fec7c..92e8e1dba69 100644 --- a/tests/ui/unused_self.rs +++ b/tests/ui/unused_self.rs @@ -53,8 +53,17 @@ mod unused_self_allow { // shouldn't trigger fn unused_self_move(self) {} } + + pub struct D; + + impl D { + // shouldn't trigger for public methods + pub fn unused_self_move(self) {} + } } +pub use unused_self_allow::D; + mod used_self { use std::pin::Pin; |
