let t = (a, b, c, d, e, f);
t;
} //^ (RangeFull, RangeFrom<i32>, RangeTo<u32>, Range<usize>, RangeToInclusive<i32>, RangeInclusive<char>)
let t = (a, b, c, d, e, f);
t;
} //^ (RangeFull, RangeFrom<i32>, RangeTo<u32>, Range<usize>, RangeToInclusive<i32>, RangeInclusive<char>)
- fn test() -> &mut &f64 {
- let a = unknown_function();
- takes_u32(a);
- let b = unknown_function();
- S { i32_field: b };
- let c = unknown_function();
- &mut &c
- }
- "#,
+fn test() -> &mut &f64 {
+ let a = unknown_function();
+ takes_u32(a);
+ let b = unknown_function();
+ S { i32_field: b };
+ let c = unknown_function();
+ &mut &c
+}
+"#,
- fn test() -> bool {
- let x = a && b;
- let y = true || false;
- let z = x == y;
- let t = x != y;
- let minus_forty: isize = -40isize;
- let h = minus_forty <= CONST_2;
- let c = f(z || y) + 5;
- let d = b;
- let g = minus_forty ^= i;
- let ten: usize = 10;
- let ten_is_eleven = ten == some_num;
-
- ten < 3
- }
- "#,
+fn test() -> bool {
+ let x = a && b;
+ let y = true || false;
+ let z = x == y;
+ let t = x != y;
+ let minus_forty: isize = -40isize;
+ let h = minus_forty <= CONST_2;
+ let c = f(z || y) + 5;
+ let d = b;
+ let g = minus_forty ^= i;
+ let ten: usize = 10;
+ let ten_is_eleven = ten == some_num;
+
+ ten < 3
+}
+"#,
- 67..71 'self': &Self
- 138..142 'self': &A<T>
- 150..173 '{ ... }': &T
- 160..167 '&self.0': &T
- 161..165 'self': &A<T>
- 161..167 'self.0': T
- 254..258 'self': &B<T>
- 277..300 '{ ... }': &T
- 287..294 '&self.0': &T
- 288..292 'self': &B<T>
- 288..294 'self.0': T
- 314..352 '{ ...))); }': ()
- 324..325 't': &i32
- 328..334 'A::foo': fn foo<i32>(&A<i32>) -> &i32
- 328..349 'A::foo...42))))': &i32
- 335..348 '&&B(B(A(42)))': &&B<B<A<i32>>>
- 336..348 '&B(B(A(42)))': &B<B<A<i32>>>
- 337..338 'B': B<B<A<i32>>>(B<A<i32>>) -> B<B<A<i32>>>
- 337..348 'B(B(A(42)))': B<B<A<i32>>>
- 339..340 'B': B<A<i32>>(A<i32>) -> B<A<i32>>
- 339..347 'B(A(42))': B<A<i32>>
- 341..342 'A': A<i32>(i32) -> A<i32>
- 341..346 'A(42)': A<i32>
- 343..345 '42': i32
+ 66..70 'self': &A<T>
+ 78..101 '{ ... }': &T
+ 88..95 '&self.0': &T
+ 89..93 'self': &A<T>
+ 89..95 'self.0': T
+ 182..186 'self': &B<T>
+ 205..228 '{ ... }': &T
+ 215..222 '&self.0': &T
+ 216..220 'self': &B<T>
+ 216..222 'self.0': T
+ 242..280 '{ ...))); }': ()
+ 252..253 't': &i32
+ 256..262 'A::foo': fn foo<i32>(&A<i32>) -> &i32
+ 256..277 'A::foo...42))))': &i32
+ 263..276 '&&B(B(A(42)))': &&B<B<A<i32>>>
+ 264..276 '&B(B(A(42)))': &B<B<A<i32>>>
+ 265..266 'B': B<B<A<i32>>>(B<A<i32>>) -> B<B<A<i32>>>
+ 265..276 'B(B(A(42)))': B<B<A<i32>>>
+ 267..268 'B': B<A<i32>>(A<i32>) -> B<A<i32>>
+ 267..275 'B(A(42))': B<A<i32>>
+ 269..270 'A': A<i32>(i32) -> A<i32>
+ 269..274 'A(42)': A<i32>
+ 271..273 '42': i32
- 67..71 'self': &Self
- 143..147 'self': &A<T>
- 149..150 'x': &A<T>
- 165..186 '{ ... }': &T
- 175..180 '&*x.0': &T
- 176..180 '*x.0': T
- 177..178 'x': &A<T>
- 177..180 'x.0': *mut T
- 267..271 'self': &B<T>
- 290..313 '{ ... }': &T
- 300..307 '&self.0': &T
- 301..305 'self': &B<T>
- 301..307 'self.0': T
- 325..326 'a': A<i32>
- 336..382 '{ ...))); }': ()
- 346..347 't': &i32
- 350..351 'A': A<i32>(*mut i32) -> A<i32>
- 350..364 'A(0 as *mut _)': A<i32>
- 350..379 'A(0 as...B(a)))': &i32
- 352..353 '0': i32
- 352..363 '0 as *mut _': *mut i32
- 369..378 '&&B(B(a))': &&B<B<A<i32>>>
- 370..378 '&B(B(a))': &B<B<A<i32>>>
- 371..372 'B': B<B<A<i32>>>(B<A<i32>>) -> B<B<A<i32>>>
- 371..378 'B(B(a))': B<B<A<i32>>>
- 373..374 'B': B<A<i32>>(A<i32>) -> B<A<i32>>
- 373..377 'B(a)': B<A<i32>>
- 375..376 'a': A<i32>
+ 71..75 'self': &A<T>
+ 77..78 'x': &A<T>
+ 93..114 '{ ... }': &T
+ 103..108 '&*x.0': &T
+ 104..108 '*x.0': T
+ 105..106 'x': &A<T>
+ 105..108 'x.0': *mut T
+ 195..199 'self': &B<T>
+ 218..241 '{ ... }': &T
+ 228..235 '&self.0': &T
+ 229..233 'self': &B<T>
+ 229..235 'self.0': T
+ 253..254 'a': A<i32>
+ 264..310 '{ ...))); }': ()
+ 274..275 't': &i32
+ 278..279 'A': A<i32>(*mut i32) -> A<i32>
+ 278..292 'A(0 as *mut _)': A<i32>
+ 278..307 'A(0 as...B(a)))': &i32
+ 280..281 '0': i32
+ 280..291 '0 as *mut _': *mut i32
+ 297..306 '&&B(B(a))': &&B<B<A<i32>>>
+ 298..306 '&B(B(a))': &B<B<A<i32>>>
+ 299..300 'B': B<B<A<i32>>>(B<A<i32>>) -> B<B<A<i32>>>
+ 299..306 'B(B(a))': B<B<A<i32>>>
+ 301..302 'B': B<A<i32>>(A<i32>) -> B<A<i32>>
+ 301..305 'B(a)': B<A<i32>>
+ 303..304 'a': A<i32>
- #[lang = "add"]
- pub trait Add<Rhs = Self> {
- /// The resulting type after applying the `+` operator.
- type Output;
-
- /// Performs the `+` operation.
- #[must_use]
- fn add(self, rhs: Rhs) -> Self::Output;
- }
-
- impl Add<V2> for V2 {
- type Output = V2;
-
- fn add(self, rhs: V2) -> V2 {
- let x = self.0[0] + rhs.0[0];
- let y = self.0[1] + rhs.0[1];
- V2([x, y])
- }
- }
+impl core::ops::Add<V2> for V2 {
+ type Output = V2;
+}
- expect![[r#"
- 207..211 'self': Self
- 213..216 'rhs': Rhs
- 299..303 'self': V2
- 305..308 'rhs': V2
- 320..422 '{ ... }': V2
- 334..335 'x': f32
- 338..342 'self': V2
- 338..344 'self.0': [f32; 2]
- 338..347 'self.0[0]': {unknown}
- 338..358 'self.0...s.0[0]': f32
- 345..346 '0': i32
- 350..353 'rhs': V2
- 350..355 'rhs.0': [f32; 2]
- 350..358 'rhs.0[0]': {unknown}
- 356..357 '0': i32
- 372..373 'y': f32
- 376..380 'self': V2
- 376..382 'self.0': [f32; 2]
- 376..385 'self.0[1]': {unknown}
- 376..396 'self.0...s.0[1]': f32
- 383..384 '1': i32
- 388..391 'rhs': V2
- 388..393 'rhs.0': [f32; 2]
- 388..396 'rhs.0[1]': {unknown}
- 394..395 '1': i32
- 406..408 'V2': V2([f32; 2]) -> V2
- 406..416 'V2([x, y])': V2
- 409..415 '[x, y]': [f32; 2]
- 410..411 'x': f32
- 413..414 'y': f32
- 436..519 '{ ... vb; }': ()
- 446..448 'va': V2
- 451..453 'V2': V2([f32; 2]) -> V2
- 451..465 'V2([0.0, 1.0])': V2
- 454..464 '[0.0, 1.0]': [f32; 2]
- 455..458 '0.0': f32
- 460..463 '1.0': f32
- 475..477 'vb': V2
- 480..482 'V2': V2([f32; 2]) -> V2
- 480..494 'V2([0.0, 1.0])': V2
- 483..493 '[0.0, 1.0]': [f32; 2]
- 484..487 '0.0': f32
- 489..492 '1.0': f32
- 505..506 'r': V2
- 509..511 'va': V2
- 509..516 'va + vb': V2
- 514..516 'vb': V2
- "#]],
- 67..71 'self': &Self
- 175..179 'self': &Box<T>
- 259..263 'self': &Box<Foo<T>>
- 289..291 '{}': ()
- 313..317 'self': &Box<Foo<T>>
- 346..348 '{}': ()
- 368..372 'self': Box<Foo<T>>
- 393..395 '{}': ()
- 409..630 '{ ...r(); }': ()
- 419..424 'boxed': Box<Foo<i32>>
- 427..430 'Box': Box<Foo<i32>>(Foo<i32>) -> Box<Foo<i32>>
- 427..442 'Box(Foo(0_i32))': Box<Foo<i32>>
- 431..434 'Foo': Foo<i32>(i32) -> Foo<i32>
- 431..441 'Foo(0_i32)': Foo<i32>
- 435..440 '0_i32': i32
- 453..457 'bad1': &i32
- 460..465 'boxed': Box<Foo<i32>>
- 460..477 'boxed....nner()': &i32
- 487..492 'good1': &i32
- 495..509 'Foo::get_inner': fn get_inner<i32>(&Box<Foo<i32>>) -> &i32
- 495..517 'Foo::g...boxed)': &i32
- 510..516 '&boxed': &Box<Foo<i32>>
- 511..516 'boxed': Box<Foo<i32>>
- 528..532 'bad2': &Foo<i32>
- 535..540 'boxed': Box<Foo<i32>>
- 535..551 'boxed....self()': &Foo<i32>
- 561..566 'good2': &Foo<i32>
- 569..582 'Foo::get_self': fn get_self<i32>(&Box<Foo<i32>>) -> &Foo<i32>
- 569..590 'Foo::g...boxed)': &Foo<i32>
- 583..589 '&boxed': &Box<Foo<i32>>
- 584..589 'boxed': Box<Foo<i32>>
- 601..606 'inner': Foo<i32>
- 609..614 'boxed': Box<Foo<i32>>
- 609..627 'boxed....nner()': Foo<i32>
+ 104..108 'self': &Box<T>
+ 188..192 'self': &Box<Foo<T>>
+ 218..220 '{}': ()
+ 242..246 'self': &Box<Foo<T>>
+ 275..277 '{}': ()
+ 297..301 'self': Box<Foo<T>>
+ 322..324 '{}': ()
+ 338..559 '{ ...r(); }': ()
+ 348..353 'boxed': Box<Foo<i32>>
+ 356..359 'Box': Box<Foo<i32>>(Foo<i32>) -> Box<Foo<i32>>
+ 356..371 'Box(Foo(0_i32))': Box<Foo<i32>>
+ 360..363 'Foo': Foo<i32>(i32) -> Foo<i32>
+ 360..370 'Foo(0_i32)': Foo<i32>
+ 364..369 '0_i32': i32
+ 382..386 'bad1': &i32
+ 389..394 'boxed': Box<Foo<i32>>
+ 389..406 'boxed....nner()': &i32
+ 416..421 'good1': &i32
+ 424..438 'Foo::get_inner': fn get_inner<i32>(&Box<Foo<i32>>) -> &i32
+ 424..446 'Foo::g...boxed)': &i32
+ 439..445 '&boxed': &Box<Foo<i32>>
+ 440..445 'boxed': Box<Foo<i32>>
+ 457..461 'bad2': &Foo<i32>
+ 464..469 'boxed': Box<Foo<i32>>
+ 464..480 'boxed....self()': &Foo<i32>
+ 490..495 'good2': &Foo<i32>
+ 498..511 'Foo::get_self': fn get_self<i32>(&Box<Foo<i32>>) -> &Foo<i32>
+ 498..519 'Foo::g...boxed)': &Foo<i32>
+ 512..518 '&boxed': &Box<Foo<i32>>
+ 513..518 'boxed': Box<Foo<i32>>
+ 530..535 'inner': Foo<i32>
+ 538..543 'boxed': Box<Foo<i32>>
+ 538..556 'boxed....nner()': Foo<i32>