aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/references.rs
diff options
context:
space:
mode:
authorKevaundray Wedderburn <[email protected]>2021-01-06 20:15:48 +0000
committerKevaundray Wedderburn <[email protected]>2021-01-07 12:09:23 +0000
commit72b9a4fbd3c12f3250b9157a1d44230e04ec8b22 (patch)
treec138363e3592c690d841aeedb9ac97d6b2ff4396 /crates/ide/src/references.rs
parent171c3c08fe245938fb25321394233de5fe2abc7c (diff)
Change <|> to $0 - Rebase
Diffstat (limited to 'crates/ide/src/references.rs')
-rw-r--r--crates/ide/src/references.rs74
1 files changed, 37 insertions, 37 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs
index fa58fc319..c95ed669c 100644
--- a/crates/ide/src/references.rs
+++ b/crates/ide/src/references.rs
@@ -331,7 +331,7 @@ mod tests {
331 fn test_struct_literal_after_space() { 331 fn test_struct_literal_after_space() {
332 check( 332 check(
333 r#" 333 r#"
334struct Foo <|>{ 334struct Foo $0{
335 a: i32, 335 a: i32,
336} 336}
337impl Foo { 337impl Foo {
@@ -354,7 +354,7 @@ fn main() {
354 fn test_struct_literal_before_space() { 354 fn test_struct_literal_before_space() {
355 check( 355 check(
356 r#" 356 r#"
357struct Foo<|> {} 357struct Foo$0 {}
358 fn main() { 358 fn main() {
359 let f: Foo; 359 let f: Foo;
360 f = Foo {}; 360 f = Foo {};
@@ -373,7 +373,7 @@ struct Foo<|> {}
373 fn test_struct_literal_with_generic_type() { 373 fn test_struct_literal_with_generic_type() {
374 check( 374 check(
375 r#" 375 r#"
376struct Foo<T> <|>{} 376struct Foo<T> $0{}
377 fn main() { 377 fn main() {
378 let f: Foo::<i32>; 378 let f: Foo::<i32>;
379 f = Foo {}; 379 f = Foo {};
@@ -391,7 +391,7 @@ struct Foo<T> <|>{}
391 fn test_struct_literal_for_tuple() { 391 fn test_struct_literal_for_tuple() {
392 check( 392 check(
393 r#" 393 r#"
394struct Foo<|>(i32); 394struct Foo$0(i32);
395 395
396fn main() { 396fn main() {
397 let f: Foo; 397 let f: Foo;
@@ -410,7 +410,7 @@ fn main() {
410 fn test_enum_after_space() { 410 fn test_enum_after_space() {
411 check( 411 check(
412 r#" 412 r#"
413enum Foo <|>{ 413enum Foo $0{
414 A, 414 A,
415 B, 415 B,
416} 416}
@@ -431,7 +431,7 @@ fn main() {
431 fn test_enum_before_space() { 431 fn test_enum_before_space() {
432 check( 432 check(
433 r#" 433 r#"
434enum Foo<|> { 434enum Foo$0 {
435 A, 435 A,
436 B, 436 B,
437} 437}
@@ -453,7 +453,7 @@ fn main() {
453 fn test_enum_with_generic_type() { 453 fn test_enum_with_generic_type() {
454 check( 454 check(
455 r#" 455 r#"
456enum Foo<T> <|>{ 456enum Foo<T> $0{
457 A(T), 457 A(T),
458 B, 458 B,
459} 459}
@@ -474,7 +474,7 @@ fn main() {
474 fn test_enum_for_tuple() { 474 fn test_enum_for_tuple() {
475 check( 475 check(
476 r#" 476 r#"
477enum Foo<|>{ 477enum Foo$0{
478 A(i8), 478 A(i8),
479 B(i8), 479 B(i8),
480} 480}
@@ -498,7 +498,7 @@ fn main() {
498fn main() { 498fn main() {
499 let mut i = 1; 499 let mut i = 1;
500 let j = 1; 500 let j = 1;
501 i = i<|> + j; 501 i = i$0 + j;
502 502
503 { 503 {
504 i = 0; 504 i = 0;
@@ -522,7 +522,7 @@ fn main() {
522 check( 522 check(
523 r#" 523 r#"
524fn foo() { 524fn foo() {
525 let spam<|> = 92; 525 let spam$0 = 92;
526 spam + spam 526 spam + spam
527} 527}
528fn bar() { 528fn bar() {
@@ -543,7 +543,7 @@ fn bar() {
543 fn test_find_all_refs_for_param_inside() { 543 fn test_find_all_refs_for_param_inside() {
544 check( 544 check(
545 r#" 545 r#"
546fn foo(i : u32) -> u32 { i<|> } 546fn foo(i : u32) -> u32 { i$0 }
547"#, 547"#,
548 expect![[r#" 548 expect![[r#"
549 i ValueParam FileId(0) 7..8 Other 549 i ValueParam FileId(0) 7..8 Other
@@ -557,7 +557,7 @@ fn foo(i : u32) -> u32 { i<|> }
557 fn test_find_all_refs_for_fn_param() { 557 fn test_find_all_refs_for_fn_param() {
558 check( 558 check(
559 r#" 559 r#"
560fn foo(i<|> : u32) -> u32 { i } 560fn foo(i$0 : u32) -> u32 { i }
561"#, 561"#,
562 expect![[r#" 562 expect![[r#"
563 i ValueParam FileId(0) 7..8 Other 563 i ValueParam FileId(0) 7..8 Other
@@ -573,7 +573,7 @@ fn foo(i<|> : u32) -> u32 { i }
573 r#" 573 r#"
574//- /lib.rs 574//- /lib.rs
575struct Foo { 575struct Foo {
576 pub spam<|>: u32, 576 pub spam$0: u32,
577} 577}
578 578
579fn main(s: Foo) { 579fn main(s: Foo) {
@@ -594,7 +594,7 @@ fn main(s: Foo) {
594 r#" 594 r#"
595struct Foo; 595struct Foo;
596impl Foo { 596impl Foo {
597 fn f<|>(&self) { } 597 fn f$0(&self) { }
598} 598}
599"#, 599"#,
600 expect![[r#" 600 expect![[r#"
@@ -610,7 +610,7 @@ impl Foo {
610 r#" 610 r#"
611enum Foo { 611enum Foo {
612 A, 612 A,
613 B<|>, 613 B$0,
614 C, 614 C,
615} 615}
616"#, 616"#,
@@ -627,7 +627,7 @@ enum Foo {
627 r#" 627 r#"
628enum Foo { 628enum Foo {
629 A, 629 A,
630 B { field<|>: u8 }, 630 B { field$0: u8 },
631 C, 631 C,
632} 632}
633"#, 633"#,
@@ -669,7 +669,7 @@ pub struct Bar {
669} 669}
670 670
671fn f() { 671fn f() {
672 let i = foo::Foo<|> { n: 5 }; 672 let i = foo::Foo$0 { n: 5 };
673} 673}
674"#, 674"#,
675 expect![[r#" 675 expect![[r#"
@@ -689,7 +689,7 @@ fn f() {
689 check( 689 check(
690 r#" 690 r#"
691//- /lib.rs 691//- /lib.rs
692mod foo<|>; 692mod foo$0;
693 693
694use foo::Foo; 694use foo::Foo;
695 695
@@ -726,7 +726,7 @@ fn f() {
726} 726}
727 727
728//- /foo/some.rs 728//- /foo/some.rs
729pub(super) struct Foo<|> { 729pub(super) struct Foo$0 {
730 pub n: u32, 730 pub n: u32,
731} 731}
732"#, 732"#,
@@ -746,7 +746,7 @@ pub(super) struct Foo<|> {
746 mod foo; 746 mod foo;
747 mod bar; 747 mod bar;
748 748
749 pub fn quux<|>() {} 749 pub fn quux$0() {}
750 750
751 //- /foo.rs 751 //- /foo.rs
752 fn f() { super::quux(); } 752 fn f() { super::quux(); }
@@ -782,7 +782,7 @@ pub(super) struct Foo<|> {
782 check( 782 check(
783 r#" 783 r#"
784#[macro_export] 784#[macro_export]
785macro_rules! m1<|> { () => (()) } 785macro_rules! m1$0 { () => (()) }
786 786
787fn foo() { 787fn foo() {
788 m1(); 788 m1();
@@ -803,7 +803,7 @@ fn foo() {
803 check( 803 check(
804 r#" 804 r#"
805fn foo() { 805fn foo() {
806 let mut i<|> = 0; 806 let mut i$0 = 0;
807 i = i + 1; 807 i = i + 1;
808} 808}
809"#, 809"#,
@@ -826,7 +826,7 @@ struct S {
826 826
827fn foo() { 827fn foo() {
828 let mut s = S{f: 0}; 828 let mut s = S{f: 0};
829 s.f<|> = 0; 829 s.f$0 = 0;
830} 830}
831"#, 831"#,
832 expect![[r#" 832 expect![[r#"
@@ -843,7 +843,7 @@ fn foo() {
843 check( 843 check(
844 r#" 844 r#"
845fn foo() { 845fn foo() {
846 let i<|>; 846 let i$0;
847 i = 1; 847 i = 1;
848} 848}
849"#, 849"#,
@@ -863,7 +863,7 @@ mod foo {
863 pub struct Foo; 863 pub struct Foo;
864 864
865 impl Foo { 865 impl Foo {
866 pub fn new<|>() -> Foo { Foo } 866 pub fn new$0() -> Foo { Foo }
867 } 867 }
868} 868}
869 869
@@ -886,7 +886,7 @@ fn main() {
886//- /lib.rs 886//- /lib.rs
887mod foo { mod bar; } 887mod foo { mod bar; }
888 888
889fn f<|>() {} 889fn f$0() {}
890 890
891//- /foo/bar.rs 891//- /foo/bar.rs
892use crate::f; 892use crate::f;
@@ -907,7 +907,7 @@ fn g() { f(); }
907 check( 907 check(
908 r#" 908 r#"
909struct S { 909struct S {
910 field<|>: u8, 910 field$0: u8,
911} 911}
912 912
913fn f(s: S) { 913fn f(s: S) {
@@ -930,7 +930,7 @@ fn f(s: S) {
930 r#" 930 r#"
931enum En { 931enum En {
932 Variant { 932 Variant {
933 field<|>: u8, 933 field$0: u8,
934 } 934 }
935} 935}
936 936
@@ -955,7 +955,7 @@ fn f(e: En) {
955mod m { 955mod m {
956 pub enum En { 956 pub enum En {
957 Variant { 957 Variant {
958 field<|>: u8, 958 field$0: u8,
959 } 959 }
960 } 960 }
961} 961}
@@ -980,7 +980,7 @@ struct Foo { bar: i32 }
980 980
981impl Foo { 981impl Foo {
982 fn foo(self) { 982 fn foo(self) {
983 let x = self<|>.bar; 983 let x = self$0.bar;
984 if true { 984 if true {
985 let _ = match () { 985 let _ = match () {
986 () => self, 986 () => self,
@@ -1032,7 +1032,7 @@ impl Foo {
1032 r#" 1032 r#"
1033trait Foo<'a> {} 1033trait Foo<'a> {}
1034impl<'a> Foo<'a> for &'a () {} 1034impl<'a> Foo<'a> for &'a () {}
1035fn foo<'a, 'b: 'a>(x: &'a<|> ()) -> &'a () where &'a (): Foo<'a> { 1035fn foo<'a, 'b: 'a>(x: &'a$0 ()) -> &'a () where &'a (): Foo<'a> {
1036 fn bar<'a>(_: &'a ()) {} 1036 fn bar<'a>(_: &'a ()) {}
1037 x 1037 x
1038} 1038}
@@ -1053,7 +1053,7 @@ fn foo<'a, 'b: 'a>(x: &'a<|> ()) -> &'a () where &'a (): Foo<'a> {
1053 fn test_find_lifetimes_type_alias() { 1053 fn test_find_lifetimes_type_alias() {
1054 check( 1054 check(
1055 r#" 1055 r#"
1056type Foo<'a, T> where T: 'a<|> = &'a T; 1056type Foo<'a, T> where T: 'a$0 = &'a T;
1057"#, 1057"#,
1058 expect![[r#" 1058 expect![[r#"
1059 'a LifetimeParam FileId(0) 9..11 9..11 Lifetime 1059 'a LifetimeParam FileId(0) 9..11 9..11 Lifetime
@@ -1072,7 +1072,7 @@ trait Foo<'a> {
1072 fn foo() -> &'a (); 1072 fn foo() -> &'a ();
1073} 1073}
1074impl<'a> Foo<'a> for &'a () { 1074impl<'a> Foo<'a> for &'a () {
1075 fn foo() -> &'a<|> () { 1075 fn foo() -> &'a$0 () {
1076 unimplemented!() 1076 unimplemented!()
1077 } 1077 }
1078} 1078}
@@ -1093,7 +1093,7 @@ impl<'a> Foo<'a> for &'a () {
1093 r#" 1093 r#"
1094macro_rules! foo {($i:ident) => {$i} } 1094macro_rules! foo {($i:ident) => {$i} }
1095fn main() { 1095fn main() {
1096 let a<|> = "test"; 1096 let a$0 = "test";
1097 foo!(a); 1097 foo!(a);
1098} 1098}
1099"#, 1099"#,
@@ -1112,7 +1112,7 @@ fn main() {
1112macro_rules! foo {($i:ident) => {$i} } 1112macro_rules! foo {($i:ident) => {$i} }
1113fn main() { 1113fn main() {
1114 let a = "test"; 1114 let a = "test";
1115 foo!(a<|>); 1115 foo!(a$0);
1116} 1116}
1117"#, 1117"#,
1118 expect![[r#" 1118 expect![[r#"
@@ -1130,7 +1130,7 @@ fn main() {
1130fn foo<'a>() -> &'a () { 1130fn foo<'a>() -> &'a () {
1131 'a: loop { 1131 'a: loop {
1132 'b: loop { 1132 'b: loop {
1133 continue 'a<|>; 1133 continue 'a$0;
1134 } 1134 }
1135 break 'a; 1135 break 'a;
1136 } 1136 }
@@ -1149,7 +1149,7 @@ fn foo<'a>() -> &'a () {
1149 fn test_find_const_param() { 1149 fn test_find_const_param() {
1150 check( 1150 check(
1151 r#" 1151 r#"
1152fn foo<const FOO<|>: usize>() -> usize { 1152fn foo<const FOO$0: usize>() -> usize {
1153 FOO 1153 FOO
1154} 1154}
1155"#, 1155"#,