about summary refs log tree commit diff
path: root/tests/ui/parallel-rustc/ty-variance-issue-127971.rs
blob: a17916843e70a118a299a54a4fa1f80ca872faa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Test for #127971, which causes an ice bug: only `variances_of` returns `&[ty::Variance]`
//
//@ compile-flags: -Z threads=16
//@ compare-output-by-lines

use std::fmt::Debug;

fn elided(_: &impl Copy + 'a) -> _ { x }
//~^ ERROR ambiguous `+` in a type
//~| ERROR use of undeclared lifetime name `'a`
//~| ERROR the placeholder `_` is not allowed within types on item signatures for return types

fn foo<'a>(_: &impl Copy + 'a) -> impl 'b + 'a { x }
//~^ ERROR ambiguous `+` in a type
//~| ERROR at least one trait must be specified
//~| ERROR use of undeclared lifetime name `'b`

fn x<'b>(_: &'a impl Copy + 'a) -> Box<dyn 'b> { Box::u32(x) }
//~^ ERROR ambiguous `+` in a type
//~| ERROR use of undeclared lifetime name `'a`
//~| ERROR use of undeclared lifetime name `'a`
//~| ERROR at least one trait is required for an object type
//~| ERROR no function or associated item named `u32` found for struct `Box<_, _>` in the current scope

fn main() {}