forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#107772 - compiler-errors:dyn-star-backend-i…
…s-ptr, r=eholk Make `dyn*`'s value backend type a pointer One tweak on top of Ralf's commit should fix using `usize` as a `dyn*`-coercible type, and should fix when we're using various other pointer types when LLVM opaque pointers is disabled. r? `@eholk` but feel free to reassign cc rust-lang#107728 (comment) `@RalfJung`
- Loading branch information
Showing
6 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// run-pass | ||
// compile-flags: --target x86_64-unknown-linux-gnu -Copt-level=0 -Cllvm-args=-opaque-pointers=0 | ||
// needs-llvm-components: x86 | ||
|
||
// (opaque-pointers flag is called force-opaque-pointers in LLVM 13...) | ||
// min-llvm-version: 14.0 | ||
|
||
// This test can be removed once non-opaque pointers are gone from LLVM, maybe. | ||
|
||
#![feature(dyn_star, pointer_like_trait)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::fmt::Debug; | ||
use std::marker::PointerLike; | ||
|
||
fn make_dyn_star<'a>(t: impl PointerLike + Debug + 'a) -> dyn* Debug + 'a { | ||
t as _ | ||
} | ||
|
||
fn main() { | ||
println!("{:?}", make_dyn_star(Box::new(1i32))); | ||
println!("{:?}", make_dyn_star(2usize)); | ||
println!("{:?}", make_dyn_star((3usize,))); | ||
} |