Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_next_trait_solver/src/solve/trait_goals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ where
}

// `rustc_transmute` does not have support for type or const params
if goal.has_non_region_placeholders() {
if goal.predicate.has_non_region_placeholders() {
return Err(NoSolution);
}

Expand Down
21 changes: 21 additions & 0 deletions tests/ui/transmutability/transmute-with-type-params.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@ [next] compile-flags: -Znext-solver
//@ check-pass

// A regression test for https://github.com/rust-lang/rust/issues/151300

#![feature(transmutability)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move this to the transmutability folder instead of the general next-solver one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll move it once I get home

use std::mem::TransmuteFrom;

pub fn is_maybe_transmutable<Src, Dst>()
where
Dst: TransmuteFrom<Src>,
{
}

fn function_with_generic<T>() {
is_maybe_transmutable::<(), ()>();
}

fn main() {}
Loading