Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3807970ab36a19b711d6ffcdcb3283745e78ce4e
Choose a base ref
..
head repository: rust-lang/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6b164ea50a510696c1110ef8544bb0f42491e7b6
Choose a head ref
Showing with 14 additions and 0 deletions.
  1. +4 −0 tests/mir-opt/build_correct_coerce.rs
  2. +10 −0 tests/ui/higher-ranked/subtyping-fn-ptr-coercion.rs
4 changes: 4 additions & 0 deletions tests/mir-opt/build_correct_coerce.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// skip-filecheck

// Validate that we record the type of the local for `x` as `for<'a> fn(&'a (), &'a ())`,
// and not `for<'a, 'b>(&'a (), &'b ())`. We previously did the latter due to a bug in
// the code that records adjustments in HIR typeck.

fn foo<'a, 'b>(_: &'a (), _: &'b ()) {}

// EMIT_MIR build_correct_coerce.main.built.after.mir
10 changes: 10 additions & 0 deletions tests/ui/higher-ranked/subtyping-fn-ptr-coercion.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ check-pass

// Check that we use subtyping when reifying a closure into a function pointer.

fn foo(x: &str) {}

fn main() {
let c = |_: &str| {};
let x = c as fn(&'static str);
}