We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7348844 commit 2071cc2Copy full SHA for 2071cc2
src/tools/rust-analyzer/crates/ide-completion/src/render.rs
@@ -2005,6 +2005,30 @@ fn f() {
2005
);
2006
}
2007
2008
+ #[test]
2009
+ fn test_avoid_redundant_suggestion() {
2010
+ check_relevance(
2011
+ r#"
2012
+struct aa([u8]);
2013
+
2014
+impl aa {
2015
+ fn from_bytes(bytes: &[u8]) -> &Self {
2016
+ unsafe { &*(bytes as *const [u8] as *const aa) }
2017
+ }
2018
+}
2019
2020
+fn bb()-> &'static aa {
2021
+ let bytes = b"hello";
2022
+ aa::$0
2023
2024
+"#,
2025
+ expect![[r#"
2026
+ ex bb() [type]
2027
+ fn from_bytes(…) fn(&[u8]) -> &aa [type_could_unify]
2028
+ "#]],
2029
+ );
2030
2031
2032
#[test]
2033
fn suggest_ref_mut() {
2034
cov_mark::check!(suggest_ref);
0 commit comments