Skip to content

Commit f52f2f9

Browse files
committed
Merge branch 'master' into sync-from-rust
2 parents c6a02e3 + 598511b commit f52f2f9

File tree

17 files changed

+242
-302
lines changed

17 files changed

+242
-302
lines changed

crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs

+41-42
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ struct Foo;
1616
#[derive(Copy)]
1717
struct Foo;
1818
19-
impl < > core::marker::Copy for Foo< > where {}"#]],
19+
impl < > $crate::marker::Copy for Foo< > where {}"#]],
2020
);
2121
}
2222

2323
#[test]
2424
fn test_copy_expand_in_core() {
25-
cov_mark::check!(test_copy_expand_in_core);
2625
check(
2726
r#"
2827
//- /lib.rs crate:core
@@ -41,7 +40,7 @@ macro Copy {}
4140
#[derive(Copy)]
4241
struct Foo;
4342
44-
impl < > crate ::marker::Copy for Foo< > where {}"#]],
43+
impl < > $crate::marker::Copy for Foo< > where {}"#]],
4544
);
4645
}
4746

@@ -57,7 +56,7 @@ struct Foo<A, B>;
5756
#[derive(Copy)]
5857
struct Foo<A, B>;
5958
60-
impl <A: core::marker::Copy, B: core::marker::Copy, > core::marker::Copy for Foo<A, B, > where {}"#]],
59+
impl <A: $crate::marker::Copy, B: $crate::marker::Copy, > $crate::marker::Copy for Foo<A, B, > where {}"#]],
6160
);
6261
}
6362

@@ -74,7 +73,7 @@ struct Foo<A, B, 'a, 'b>;
7473
#[derive(Copy)]
7574
struct Foo<A, B, 'a, 'b>;
7675
77-
impl <A: core::marker::Copy, B: core::marker::Copy, > core::marker::Copy for Foo<A, B, > where {}"#]],
76+
impl <A: $crate::marker::Copy, B: $crate::marker::Copy, > $crate::marker::Copy for Foo<A, B, > where {}"#]],
7877
);
7978
}
8079

@@ -98,7 +97,7 @@ enum Command<A, B> {
9897
Jump,
9998
}
10099
101-
impl <A: core::clone::Clone, B: core::clone::Clone, > core::clone::Clone for Command<A, B, > where {
100+
impl <A: $crate::clone::Clone, B: $crate::clone::Clone, > $crate::clone::Clone for Command<A, B, > where {
102101
fn clone(&self ) -> Self {
103102
match self {
104103
Command::Move {
@@ -158,7 +157,7 @@ where
158157
generic: Vec<T::InGenericArg>,
159158
}
160159
161-
impl <T: core::clone::Clone, > core::clone::Clone for Foo<T, > where T: Trait, T::InFieldShorthand: core::clone::Clone, T::InGenericArg: core::clone::Clone, {
160+
impl <T: $crate::clone::Clone, > $crate::clone::Clone for Foo<T, > where T: Trait, T::InFieldShorthand: $crate::clone::Clone, T::InGenericArg: $crate::clone::Clone, {
162161
fn clone(&self ) -> Self {
163162
match self {
164163
Foo {
@@ -186,7 +185,7 @@ struct Foo<const X: usize, T>(u32);
186185
#[derive(Clone)]
187186
struct Foo<const X: usize, T>(u32);
188187
189-
impl <const X: usize, T: core::clone::Clone, > core::clone::Clone for Foo<X, T, > where {
188+
impl <const X: usize, T: $crate::clone::Clone, > $crate::clone::Clone for Foo<X, T, > where {
190189
fn clone(&self ) -> Self {
191190
match self {
192191
Foo(f0, )=>Foo(f0.clone(), ),
@@ -226,14 +225,14 @@ enum Bar {
226225
Bar,
227226
}
228227
229-
impl < > core::default::Default for Foo< > where {
228+
impl < > $crate::default::Default for Foo< > where {
230229
fn default() -> Self {
231230
Foo {
232-
field1: core::default::Default::default(), field2: core::default::Default::default(),
231+
field1: $crate::default::Default::default(), field2: $crate::default::Default::default(),
233232
}
234233
}
235234
}
236-
impl < > core::default::Default for Bar< > where {
235+
impl < > $crate::default::Default for Bar< > where {
237236
fn default() -> Self {
238237
Bar::Bar
239238
}
@@ -261,7 +260,7 @@ enum Command {
261260
Jump,
262261
}
263262
264-
impl < > core::cmp::PartialEq for Command< > where {
263+
impl < > $crate::cmp::PartialEq for Command< > where {
265264
fn eq(&self , other: &Self ) -> bool {
266265
match (self , other) {
267266
(Command::Move {
@@ -274,7 +273,7 @@ impl < > core::cmp::PartialEq for Command< > where {
274273
}
275274
}
276275
}
277-
impl < > core::cmp::Eq for Command< > where {}"#]],
276+
impl < > $crate::cmp::Eq for Command< > where {}"#]],
278277
);
279278
}
280279

@@ -299,7 +298,7 @@ enum Command {
299298
Jump,
300299
}
301300
302-
impl < > core::cmp::PartialEq for Command< > where {
301+
impl < > $crate::cmp::PartialEq for Command< > where {
303302
fn eq(&self , other: &Self ) -> bool {
304303
match (self , other) {
305304
(Command::Move {
@@ -312,7 +311,7 @@ impl < > core::cmp::PartialEq for Command< > where {
312311
}
313312
}
314313
}
315-
impl < > core::cmp::Eq for Command< > where {}"#]],
314+
impl < > $crate::cmp::Eq for Command< > where {}"#]],
316315
);
317316
}
318317

@@ -336,10 +335,10 @@ enum Command {
336335
Jump,
337336
}
338337
339-
impl < > core::cmp::PartialOrd for Command< > where {
340-
fn partial_cmp(&self , other: &Self ) -> core::option::Option::Option<core::cmp::Ordering> {
341-
match core::intrinsics::discriminant_value(self ).partial_cmp(&core::intrinsics::discriminant_value(other)) {
342-
core::option::Option::Some(core::cmp::Ordering::Equal)=> {
338+
impl < > $crate::cmp::PartialOrd for Command< > where {
339+
fn partial_cmp(&self , other: &Self ) -> $crate::option::Option::Option<$crate::cmp::Ordering> {
340+
match $crate::intrinsics::discriminant_value(self ).partial_cmp(&$crate::intrinsics::discriminant_value(other)) {
341+
$crate::option::Option::Some($crate::cmp::Ordering::Equal)=> {
343342
match (self , other) {
344343
(Command::Move {
345344
x: x_self, y: y_self,
@@ -348,33 +347,33 @@ impl < > core::cmp::PartialOrd for Command< > where {
348347
x: x_other, y: y_other,
349348
}
350349
)=>match x_self.partial_cmp(&x_other) {
351-
core::option::Option::Some(core::cmp::Ordering::Equal)=> {
350+
$crate::option::Option::Some($crate::cmp::Ordering::Equal)=> {
352351
match y_self.partial_cmp(&y_other) {
353-
core::option::Option::Some(core::cmp::Ordering::Equal)=> {
354-
core::option::Option::Some(core::cmp::Ordering::Equal)
352+
$crate::option::Option::Some($crate::cmp::Ordering::Equal)=> {
353+
$crate::option::Option::Some($crate::cmp::Ordering::Equal)
355354
}
356355
c=>return c,
357356
}
358357
}
359358
c=>return c,
360359
}
361360
, (Command::Do(f0_self, ), Command::Do(f0_other, ))=>match f0_self.partial_cmp(&f0_other) {
362-
core::option::Option::Some(core::cmp::Ordering::Equal)=> {
363-
core::option::Option::Some(core::cmp::Ordering::Equal)
361+
$crate::option::Option::Some($crate::cmp::Ordering::Equal)=> {
362+
$crate::option::Option::Some($crate::cmp::Ordering::Equal)
364363
}
365364
c=>return c,
366365
}
367-
, (Command::Jump, Command::Jump)=>core::option::Option::Some(core::cmp::Ordering::Equal), _unused=>core::option::Option::Some(core::cmp::Ordering::Equal)
366+
, (Command::Jump, Command::Jump)=>$crate::option::Option::Some($crate::cmp::Ordering::Equal), _unused=>$crate::option::Option::Some($crate::cmp::Ordering::Equal)
368367
}
369368
}
370369
c=>return c,
371370
}
372371
}
373372
}
374-
impl < > core::cmp::Ord for Command< > where {
375-
fn cmp(&self , other: &Self ) -> core::cmp::Ordering {
376-
match core::intrinsics::discriminant_value(self ).cmp(&core::intrinsics::discriminant_value(other)) {
377-
core::cmp::Ordering::Equal=> {
373+
impl < > $crate::cmp::Ord for Command< > where {
374+
fn cmp(&self , other: &Self ) -> $crate::cmp::Ordering {
375+
match $crate::intrinsics::discriminant_value(self ).cmp(&$crate::intrinsics::discriminant_value(other)) {
376+
$crate::cmp::Ordering::Equal=> {
378377
match (self , other) {
379378
(Command::Move {
380379
x: x_self, y: y_self,
@@ -383,23 +382,23 @@ impl < > core::cmp::Ord for Command< > where {
383382
x: x_other, y: y_other,
384383
}
385384
)=>match x_self.cmp(&x_other) {
386-
core::cmp::Ordering::Equal=> {
385+
$crate::cmp::Ordering::Equal=> {
387386
match y_self.cmp(&y_other) {
388-
core::cmp::Ordering::Equal=> {
389-
core::cmp::Ordering::Equal
387+
$crate::cmp::Ordering::Equal=> {
388+
$crate::cmp::Ordering::Equal
390389
}
391390
c=>return c,
392391
}
393392
}
394393
c=>return c,
395394
}
396395
, (Command::Do(f0_self, ), Command::Do(f0_other, ))=>match f0_self.cmp(&f0_other) {
397-
core::cmp::Ordering::Equal=> {
398-
core::cmp::Ordering::Equal
396+
$crate::cmp::Ordering::Equal=> {
397+
$crate::cmp::Ordering::Equal
399398
}
400399
c=>return c,
401400
}
402-
, (Command::Jump, Command::Jump)=>core::cmp::Ordering::Equal, _unused=>core::cmp::Ordering::Equal
401+
, (Command::Jump, Command::Jump)=>$crate::cmp::Ordering::Equal, _unused=>$crate::cmp::Ordering::Equal
403402
}
404403
}
405404
c=>return c,
@@ -433,8 +432,8 @@ struct Foo {
433432
z: (i32, u64),
434433
}
435434
436-
impl < > core::hash::Hash for Foo< > where {
437-
fn hash<H: core::hash::Hasher>(&self , ra_expand_state: &mut H) {
435+
impl < > $crate::hash::Hash for Foo< > where {
436+
fn hash<H: $crate::hash::Hasher>(&self , ra_expand_state: &mut H) {
438437
match self {
439438
Foo {
440439
x: x, y: y, z: z,
@@ -471,9 +470,9 @@ enum Command {
471470
Jump,
472471
}
473472
474-
impl < > core::hash::Hash for Command< > where {
475-
fn hash<H: core::hash::Hasher>(&self , ra_expand_state: &mut H) {
476-
core::mem::discriminant(self ).hash(ra_expand_state);
473+
impl < > $crate::hash::Hash for Command< > where {
474+
fn hash<H: $crate::hash::Hasher>(&self , ra_expand_state: &mut H) {
475+
$crate::mem::discriminant(self ).hash(ra_expand_state);
477476
match self {
478477
Command::Move {
479478
x: x, y: y,
@@ -517,8 +516,8 @@ enum Command {
517516
Jump,
518517
}
519518
520-
impl < > core::fmt::Debug for Command< > where {
521-
fn fmt(&self , f: &mut core::fmt::Formatter) -> core::fmt::Result {
519+
impl < > $crate::fmt::Debug for Command< > where {
520+
fn fmt(&self , f: &mut $crate::fmt::Formatter) -> $crate::fmt::Result {
522521
match self {
523522
Command::Move {
524523
x: x, y: y,

crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn main() { option_env!("TEST_ENV_VAR"); }
136136
#[rustc_builtin_macro]
137137
macro_rules! option_env {() => {}}
138138
139-
fn main() { ::core::option::Option::None:: < &str>; }
139+
fn main() { $crate::option::Option::None:: < &str>; }
140140
"#]],
141141
);
142142
}

0 commit comments

Comments
 (0)