mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +00:00
19 lines
709 B
Rust
19 lines
709 B
Rust
// Regression test for ICE #124848
|
|
// Tests that there is no ICE when a cast
|
|
// involves a type with error
|
|
|
|
use std::cell::Cell;
|
|
|
|
struct MyType<'a>(Cell<Option<&'unpinned mut MyType<'a>>>, Pin);
|
|
//~^ ERROR use of undeclared lifetime name `'unpinned`
|
|
//~| ERROR cannot find type `Pin` in this scope
|
|
|
|
fn main() {
|
|
let mut unpinned = MyType(Cell::new(None));
|
|
//~^ ERROR his struct takes 2 arguments but 1 argument was supplied
|
|
let bad_addr = &unpinned as *const Cell<Option<&'a mut MyType<'a>>> as usize;
|
|
//~^ ERROR use of undeclared lifetime name `'a`
|
|
//~| ERROR use of undeclared lifetime name `'a`
|
|
//~| ERROR casting `&MyType<'_>` as `*const Cell<Option<&mut MyType<'_>>>` is invalid
|
|
}
|