Skip to content

Commit 4b5a9a3

Browse files
Mathieu BorderéMathieu Borderé
Mathieu Borderé
authored and
Mathieu Borderé
committed
ICH: update saw_ty for TyBareFn; Update tests for functioninterfaces
1 parent 14fe7ce commit 4b5a9a3

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

src/librustc_incremental/calculate_svh/svh_visitor.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ enum SawTyComponent {
349349
SawTyArray,
350350
SawTyPtr(Mutability),
351351
SawTyRptr(Mutability),
352-
SawTyBareFn,
352+
SawTyBareFn(Unsafety, Abi),
353353
SawTyNever,
354354
SawTyTup,
355355
SawTyPath,
@@ -366,7 +366,10 @@ fn saw_ty(node: &Ty_) -> SawTyComponent {
366366
TyArray(..) => SawTyArray,
367367
TyPtr(ref mty) => SawTyPtr(mty.mutbl),
368368
TyRptr(_, ref mty) => SawTyRptr(mty.mutbl),
369-
TyBareFn(..) => SawTyBareFn,
369+
TyBareFn(ref barefnty) => {
370+
let ref fnty = *barefnty;
371+
SawTyBareFn(fnty.unsafety, fnty.abi)
372+
},
370373
TyNever => SawTyNever,
371374
TyTup(..) => SawTyTup,
372375
TyPath(..) => SawTyPath,

src/test/incremental/hashes/function_interfaces.rs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ fn type_of_parameter_ref(p: &mut i32) {}
8484
// Change Parameter Order ------------------------------------------------------
8585

8686
#[cfg(cfail1)]
87-
fn order_of_parameters(p1: i32, p2: i32) {}
87+
fn order_of_parameters(p1: i32, p2: i64) {}
8888

8989
#[cfg(not(cfail1))]
9090
#[rustc_dirty(label="Hir", cfg="cfail2")]
9191
#[rustc_clean(label="Hir", cfg="cfail3")]
9292
#[rustc_metadata_dirty(cfg="cfail2")]
9393
#[rustc_metadata_clean(cfg="cfail3")]
94-
fn order_of_parameters(p2: i32, p1: i32) {}
94+
fn order_of_parameters(p2: i64, p1: i32) {}
9595

9696

9797
// Unsafe ----------------------------------------------------------------------
@@ -188,7 +188,7 @@ fn builtin_bound<T: Send>() {}
188188
// Lifetime Bound --------------------------------------------------------------
189189

190190
#[cfg(cfail1)]
191-
fn lifetime_bound<T>() {}
191+
fn lifetime_bound<'a, T>() {}
192192

193193
#[cfg(not(cfail1))]
194194
#[rustc_dirty(label="Hir", cfg="cfail2")]
@@ -227,7 +227,7 @@ fn second_builtin_bound<T: Send + Sized>() {}
227227
// Second Lifetime Bound -------------------------------------------------------
228228

229229
#[cfg(cfail1)]
230-
fn second_lifetime_bound<'a, T: 'a>() {}
230+
fn second_lifetime_bound<'a, 'b, T: 'a>() {}
231231

232232
#[cfg(not(cfail1))]
233233
#[rustc_dirty(label="Hir", cfg="cfail2")]
@@ -254,6 +254,7 @@ fn inline() {}
254254
// Inline Never ----------------------------------------------------------------
255255

256256
#[cfg(cfail1)]
257+
#[inline(always)]
257258
fn inline_never() {}
258259

259260
#[cfg(not(cfail1))]
@@ -289,7 +290,7 @@ fn linkage() {}
289290
#[rustc_clean(label="Hir", cfg="cfail3")]
290291
#[rustc_metadata_dirty(cfg="cfail2")]
291292
#[rustc_metadata_clean(cfg="cfail3")]
292-
#[linkage]
293+
#[linkage="weak_odr"]
293294
fn linkage() {}
294295

295296

@@ -310,6 +311,23 @@ fn return_impl_trait() -> impl Clone {
310311
}
311312

312313

314+
// Change Return Impl Trait ----------------------------------------------------
315+
316+
#[cfg(cfail1)]
317+
fn change_return_impl_trait() -> impl Clone {
318+
0
319+
}
320+
321+
#[cfg(not(cfail1))]
322+
#[rustc_dirty(label="Hir", cfg="cfail2")]
323+
#[rustc_clean(label="Hir", cfg="cfail3")]
324+
#[rustc_metadata_dirty(cfg="cfail2")]
325+
#[rustc_metadata_clean(cfg="cfail3")]
326+
fn change_return_impl_trait() -> impl Copy {
327+
0
328+
}
329+
330+
313331
// Change Return Type Indirectly -----------------------------------------------
314332

315333
struct ReferencedType1;

0 commit comments

Comments
 (0)