forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#99384 - compiler-errors:issue-99375, r=oli-obk
use body's param-env when checking if type needs drop The type comes from the body, so we should be using the body's param-env, as opposed to the ADT's param env, because we know less in the latter compared to the former. Fixes rust-lang#99375
- Loading branch information
Showing
3 changed files
with
25 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// check-pass | ||
|
||
union URes<R: Copy> { | ||
uninit: (), | ||
init: R, | ||
} | ||
|
||
struct Params<F, R: Copy> { | ||
function: F, | ||
result: URes<R>, | ||
} | ||
|
||
unsafe extern "C" fn do_call<F, R>(params: *mut Params<F, R>) | ||
where | ||
R: Copy, | ||
F: Fn() -> R, | ||
{ | ||
(*params).result.init = ((*params).function)(); | ||
} | ||
|
||
fn main() {} |