aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/body/scope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/body/scope.rs')
-rw-r--r--crates/hir_def/src/body/scope.rs30
1 files changed, 15 insertions, 15 deletions
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 {
194 let mut buf = String::new(); 194 let mut buf = String::new();
195 let off: usize = offset.into(); 195 let off: usize = offset.into();
196 buf.push_str(&code[..off]); 196 buf.push_str(&code[..off]);
197 buf.push_str("<|>marker"); 197 buf.push_str("$0marker");
198 buf.push_str(&code[off..]); 198 buf.push_str(&code[off..]);
199 buf 199 buf
200 }; 200 };
@@ -231,7 +231,7 @@ mod tests {
231 r" 231 r"
232 fn quux(foo: i32) { 232 fn quux(foo: i32) {
233 let f = |bar, baz: i32| { 233 let f = |bar, baz: i32| {
234 <|> 234 $0
235 }; 235 };
236 }", 236 }",
237 &["bar", "baz", "foo"], 237 &["bar", "baz", "foo"],
@@ -243,7 +243,7 @@ mod tests {
243 do_check( 243 do_check(
244 r" 244 r"
245 fn quux() { 245 fn quux() {
246 f(|x| <|> ); 246 f(|x| $0 );
247 }", 247 }",
248 &["x"], 248 &["x"],
249 ); 249 );
@@ -254,7 +254,7 @@ mod tests {
254 do_check( 254 do_check(
255 r" 255 r"
256 fn quux() { 256 fn quux() {
257 z.f(|x| <|> ); 257 z.f(|x| $0 );
258 }", 258 }",
259 &["x"], 259 &["x"],
260 ); 260 );
@@ -267,7 +267,7 @@ mod tests {
267 fn quux() { 267 fn quux() {
268 loop { 268 loop {
269 let x = (); 269 let x = ();
270 <|> 270 $0
271 }; 271 };
272 }", 272 }",
273 &["x"], 273 &["x"],
@@ -281,7 +281,7 @@ mod tests {
281 fn quux() { 281 fn quux() {
282 match () { 282 match () {
283 Some(x) => { 283 Some(x) => {
284 <|> 284 $0
285 } 285 }
286 }; 286 };
287 }", 287 }",
@@ -294,7 +294,7 @@ mod tests {
294 do_check( 294 do_check(
295 r" 295 r"
296 fn foo(x: String) { 296 fn foo(x: String) {
297 let x : &str = &x<|>; 297 let x : &str = &x$0;
298 }", 298 }",
299 &["x"], 299 &["x"],
300 ); 300 );
@@ -307,7 +307,7 @@ mod tests {
307fn foo() { 307fn foo() {
308 match Some(()) { 308 match Some(()) {
309 opt @ Some(unit) => { 309 opt @ Some(unit) => {
310 <|> 310 $0
311 } 311 }
312 _ => {} 312 _ => {}
313 } 313 }
@@ -330,7 +330,7 @@ fn foo() {
330 330
331 fn foo() { 331 fn foo() {
332 mac!(); 332 mac!();
333 <|> 333 $0
334 } 334 }
335 ", 335 ",
336 &[], 336 &[],
@@ -343,7 +343,7 @@ fn foo() {
343 r" 343 r"
344 fn foo() { 344 fn foo() {
345 trait {} 345 trait {}
346 <|> 346 $0
347 } 347 }
348 ", 348 ",
349 &[], 349 &[],
@@ -391,7 +391,7 @@ fn foo(x: i32, y: u32) {
391 let z = x * 2; 391 let z = x * 2;
392 } 392 }
393 { 393 {
394 let t = x<|> * 3; 394 let t = x$0 * 3;
395 } 395 }
396} 396}
397"#, 397"#,
@@ -404,7 +404,7 @@ fn foo(x: i32, y: u32) {
404 do_check_local_name( 404 do_check_local_name(
405 r#" 405 r#"
406fn foo(x: String) { 406fn foo(x: String) {
407 let x : &str = &x<|>; 407 let x : &str = &x$0;
408} 408}
409"#, 409"#,
410 7, 410 7,
@@ -417,7 +417,7 @@ fn foo(x: String) {
417 r" 417 r"
418fn foo(x: String) { 418fn foo(x: String) {
419 let x : &str = &x; 419 let x : &str = &x;
420 x<|> 420 x$0
421} 421}
422", 422",
423 28, 423 28,
@@ -430,7 +430,7 @@ fn foo(x: String) {
430 r" 430 r"
431fn foo() { 431fn foo() {
432 if let Some(&from) = bar() { 432 if let Some(&from) = bar() {
433 from<|>; 433 from$0;
434 } 434 }
435} 435}
436", 436",
@@ -446,7 +446,7 @@ fn foo() {
446fn test() { 446fn test() {
447 let foo: Option<f32> = None; 447 let foo: Option<f32> = None;
448 while let Option::Some(spam) = foo { 448 while let Option::Some(spam) = foo {
449 spam<|> 449 spam$0
450 } 450 }
451} 451}
452"#, 452"#,