8000 Suspicious `AsRef` implementation · Issue #1599 · trailofbits/dylint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Suspicious AsRef implementation #1599

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.

8000 Already on GitHub? Sign in to your account

Open
smoelius opened this issue Jun 11, 2024 · 1 comment
Open

Suspicious AsRef implementation #1599

smoelius opened this issue Jun 11, 2024 · 1 comment
Labels
lint New lint or lint enhancement

Comments

@smoelius
Copy link
Collaborator

AsRef<T> where T itself implements AsRef for some other type.

Examples would include:

  • AsRef<PathBuf> (AsRef<Path> is better)
  • AsRef<String> (AsRef<str> is better)
@smoelius
Copy link
Collaborator Author
smoelius commented Jun 11, 2024

@incertia points out this should not catch automatically derived AsRef implementations:

^will this catch automatically derived AsRef<String> in the case of Box<String> etc?

EDIT: https://doc.rust-lang.org/std/boxed/struct.Box.html#impl-AsRef%3CT%3E-for-Box%3CT,+A%3E

@smoelius smoelius transferred this issue from another repository Apr 20, 2025
@smoelius smoelius transferred this issue from another repository Apr 20, 2025
@smoelius smoelius added the lint New lint or lint enhancement label Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lint New lint or lint enhancement
Projects
None yet
Development

No branches or pull requests

1 participant
0