rust/tests/ui/regions/issue-102374.rs
Mahdi Dibaiee 8df39667dc new unstable option: -Zwrite-long-types-to-disk
This option guards the logic of writing long type names in files and
instead using short forms in error messages in rustc_middle/ty/error
behind a flag. The main motivation for this change is to disable this
behaviour when running ui tests.

This logic can be triggered by running tests in a directory that has a
long enough path, e.g. /my/very-long-path/where/rust-codebase/exists/

This means ui tests can fail depending on how long the path to their
file is.

Some ui tests actually rely on this behaviour for their assertions,
so for those we enable the flag manually.
2023-07-24 12:25:05 +01:00

23 lines
732 B
Rust

// compile-flags: -Zwrite-long-types-to-disk=yes
// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
use std::cell::Cell;
#[rustfmt::skip]
fn f(
f: for<'a, 'b, 'c, 'd, 'e, 'f, 'g,
'h, 'i, 'j, 'k, 'l, 'm, 'n,
'o, 'p, 'q, 'r, 's, 't, 'u,
'v, 'w, 'x, 'y, 'z, 'z0>
fn(Cell<(& i32, &'a i32, &'b i32, &'c i32, &'d i32,
&'e i32, &'f i32, &'g i32, &'h i32, &'i i32,
&'j i32, &'k i32, &'l i32, &'m i32, &'n i32,
&'o i32, &'p i32, &'q i32, &'r i32, &'s i32,
&'t i32, &'u i32, &'v i32, &'w i32, &'x i32,
&'y i32, &'z i32, &'z0 i32)>),
) -> i32 {
f
//~^ ERROR mismatched types
}
fn main() {}