From 72b9a4fbd3c12f3250b9157a1d44230e04ec8b22 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Wed, 6 Jan 2021 20:15:48 +0000 Subject: Change <|> to $0 - Rebase --- crates/hir_def/src/body/scope.rs | 30 ++++++++-------- crates/hir_def/src/find_path.rs | 48 ++++++++++++------------- crates/hir_def/src/nameres/tests/incremental.rs | 4 +-- 3 files changed, 41 insertions(+), 41 deletions(-) (limited to 'crates/hir_def') diff --git a/crates/hir_def/src/body/scope.rs b/crates/hir_def/src/body/scope.rs index 9142bc05b..065785da7 100644 --- a/crates/hir_def/src/body/scope.rs +++ b/crates/hir_def/src/body/scope.rs @@ -194,7 +194,7 @@ mod tests { let mut buf = String::new(); let off: usize = offset.into(); buf.push_str(&code[..off]); - buf.push_str("<|>marker"); + buf.push_str("$0marker"); buf.push_str(&code[off..]); buf }; @@ -231,7 +231,7 @@ mod tests { r" fn quux(foo: i32) { let f = |bar, baz: i32| { - <|> + $0 }; }", &["bar", "baz", "foo"], @@ -243,7 +243,7 @@ mod tests { do_check( r" fn quux() { - f(|x| <|> ); + f(|x| $0 ); }", &["x"], ); @@ -254,7 +254,7 @@ mod tests { do_check( r" fn quux() { - z.f(|x| <|> ); + z.f(|x| $0 ); }", &["x"], ); @@ -267,7 +267,7 @@ mod tests { fn quux() { loop { let x = (); - <|> + $0 }; }", &["x"], @@ -281,7 +281,7 @@ mod tests { fn quux() { match () { Some(x) => { - <|> + $0 } }; }", @@ -294,7 +294,7 @@ mod tests { do_check( r" fn foo(x: String) { - let x : &str = &x<|>; + let x : &str = &x$0; }", &["x"], ); @@ -307,7 +307,7 @@ mod tests { fn foo() { match Some(()) { opt @ Some(unit) => { - <|> + $0 } _ => {} } @@ -330,7 +330,7 @@ fn foo() { fn foo() { mac!(); - <|> + $0 } ", &[], @@ -343,7 +343,7 @@ fn foo() { r" fn foo() { trait {} - <|> + $0 } ", &[], @@ -391,7 +391,7 @@ fn foo(x: i32, y: u32) { let z = x * 2; } { - let t = x<|> * 3; + let t = x$0 * 3; } } "#, @@ -404,7 +404,7 @@ fn foo(x: i32, y: u32) { do_check_local_name( r#" fn foo(x: String) { - let x : &str = &x<|>; + let x : &str = &x$0; } "#, 7, @@ -417,7 +417,7 @@ fn foo(x: String) { r" fn foo(x: String) { let x : &str = &x; - x<|> + x$0 } ", 28, @@ -430,7 +430,7 @@ fn foo(x: String) { r" fn foo() { if let Some(&from) = bar() { - from<|>; + from$0; } } ", @@ -446,7 +446,7 @@ fn foo() { fn test() { let foo: Option = None; while let Option::Some(spam) = foo { - spam<|> + spam$0 } } "#, diff --git a/crates/hir_def/src/find_path.rs b/crates/hir_def/src/find_path.rs index 02613c4c4..4a212d291 100644 --- a/crates/hir_def/src/find_path.rs +++ b/crates/hir_def/src/find_path.rs @@ -410,7 +410,7 @@ mod tests { let code = r#" //- /main.rs struct S; - <|> + $0 "#; check_found_path(code, "S", "S", "crate::S", "self::S"); } @@ -420,7 +420,7 @@ mod tests { let code = r#" //- /main.rs enum E { A } - <|> + $0 "#; check_found_path(code, "E::A", "E::A", "E::A", "E::A"); } @@ -432,7 +432,7 @@ mod tests { mod foo { pub struct S; } - <|> + $0 "#; check_found_path(code, "foo::S", "foo::S", "crate::foo::S", "self::foo::S"); } @@ -446,7 +446,7 @@ mod tests { mod bar; struct S; //- /foo/bar.rs - <|> + $0 "#; check_found_path(code, "super::S", "super::S", "crate::foo::S", "super::S"); } @@ -457,7 +457,7 @@ mod tests { //- /main.rs mod foo; //- /foo.rs - <|> + $0 "#; check_found_path(code, "self", "self", "crate::foo", "self"); } @@ -468,7 +468,7 @@ mod tests { //- /main.rs mod foo; //- /foo.rs - <|> + $0 "#; check_found_path(code, "crate", "crate", "crate", "crate"); } @@ -480,7 +480,7 @@ mod tests { mod foo; struct S; //- /foo.rs - <|> + $0 "#; check_found_path(code, "crate::S", "crate::S", "crate::S", "crate::S"); } @@ -489,7 +489,7 @@ mod tests { fn different_crate() { let code = r#" //- /main.rs crate:main deps:std - <|> + $0 //- /std.rs crate:std pub struct S; "#; @@ -501,7 +501,7 @@ mod tests { let code = r#" //- /main.rs crate:main deps:std extern crate std as std_renamed; - <|> + $0 //- /std.rs crate:std pub struct S; "#; @@ -523,7 +523,7 @@ mod tests { //- /main.rs crate:main deps:syntax use syntax::ast; - <|> + $0 //- /lib.rs crate:syntax pub mod ast { @@ -543,7 +543,7 @@ mod tests { let code = r#" //- /main.rs crate:main deps:syntax - <|> + $0 //- /lib.rs crate:syntax pub mod ast { @@ -569,7 +569,7 @@ mod tests { mod foo { pub(super) struct S; } pub(crate) use foo::*; } - <|> + $0 "#; check_found_path(code, "bar::S", "bar::S", "crate::bar::S", "self::bar::S"); } @@ -582,7 +582,7 @@ mod tests { mod foo { pub(super) struct S; } pub(crate) use foo::S as U; } - <|> + $0 "#; check_found_path(code, "bar::U", "bar::U", "crate::bar::U", "self::bar::U"); } @@ -591,7 +591,7 @@ mod tests { fn different_crate_reexport() { let code = r#" //- /main.rs crate:main deps:std - <|> + $0 //- /std.rs crate:std deps:core pub use core::S; //- /core.rs crate:core @@ -604,7 +604,7 @@ mod tests { fn prelude() { let code = r#" //- /main.rs crate:main deps:std - <|> + $0 //- /std.rs crate:std pub mod prelude { pub struct S; } #[prelude_import] @@ -617,7 +617,7 @@ mod tests { fn enum_variant_from_prelude() { let code = r#" //- /main.rs crate:main deps:std - <|> + $0 //- /std.rs crate:std pub mod prelude { pub enum Option { Some(T), None } @@ -637,7 +637,7 @@ mod tests { pub mod foo; pub mod baz; struct S; - <|> + $0 //- /foo.rs pub mod bar { pub struct S; } //- /baz.rs @@ -654,7 +654,7 @@ mod tests { pub mod bar { pub struct S; } use bar::S; //- /foo.rs - <|> + $0 "#; // crate::S would be shorter, but using private imports seems wrong check_found_path(code, "crate::bar::S", "crate::bar::S", "crate::bar::S", "crate::bar::S"); @@ -668,7 +668,7 @@ mod tests { pub mod bar; pub mod baz; //- /bar.rs - <|> + $0 //- /foo.rs pub use super::baz; pub struct S; @@ -683,7 +683,7 @@ mod tests { mark::check!(prefer_std_paths); let code = r#" //- /main.rs crate:main deps:alloc,std - <|> + $0 //- /std.rs crate:std deps:alloc pub mod sync { @@ -711,7 +711,7 @@ mod tests { //- /main.rs crate:main deps:core,std #![no_std] - <|> + $0 //- /std.rs crate:std deps:core @@ -740,7 +740,7 @@ mod tests { //- /main.rs crate:main deps:alloc,std #![no_std] - <|> + $0 //- /std.rs crate:std deps:alloc @@ -767,7 +767,7 @@ mod tests { fn prefer_shorter_paths_if_not_alloc() { let code = r#" //- /main.rs crate:main deps:megaalloc,std - <|> + $0 //- /std.rs crate:std deps:megaalloc pub mod sync { @@ -790,7 +790,7 @@ mod tests { fn builtins_are_in_scope() { let code = r#" //- /main.rs - <|> + $0 pub mod primitive { pub use u8; diff --git a/crates/hir_def/src/nameres/tests/incremental.rs b/crates/hir_def/src/nameres/tests/incremental.rs index 8981fa7c9..509e1bbbc 100644 --- a/crates/hir_def/src/nameres/tests/incremental.rs +++ b/crates/hir_def/src/nameres/tests/incremental.rs @@ -28,7 +28,7 @@ fn typing_inside_a_function_should_not_invalidate_def_map() { check_def_map_is_not_recomputed( r" //- /lib.rs - mod foo;<|> + mod foo;$0 use crate::foo::bar::Baz; @@ -81,7 +81,7 @@ fn typing_inside_a_macro_should_not_invalidate_def_map() { pub mod bar; //- /foo/bar.rs - <|> + $0 m!(X); ", ); -- cgit v1.2.3