-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skip known panics lint for impossible items
- Loading branch information
Lukas Markeffsky
committed
Mar 28, 2024
1 parent
551abd6
commit f465222
Showing
4 changed files
with
80 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//@ build-pass | ||
// Regression test for an ICE: https://github.com/rust-lang/rust/issues/123134 | ||
|
||
trait Api: Sized { | ||
type Device: ?Sized; | ||
} | ||
|
||
struct OpenDevice<A: Api> | ||
where | ||
A::Device: Sized, | ||
{ | ||
device: A::Device, | ||
queue: (), | ||
} | ||
|
||
trait Adapter { | ||
type A: Api; | ||
|
||
fn open() -> OpenDevice<Self::A> | ||
where | ||
<Self::A as Api>::Device: Sized; | ||
} | ||
|
||
struct ApiS; | ||
|
||
impl Api for ApiS { | ||
type Device = [u8]; | ||
} | ||
|
||
impl<T> Adapter for T | ||
{ | ||
type A = ApiS; | ||
|
||
// This function has the impossible predicate `[u8]: Sized`. | ||
fn open() -> OpenDevice<Self::A> | ||
where | ||
<Self::A as Api>::Device: Sized, | ||
{ | ||
unreachable!() | ||
} | ||
} | ||
|
||
fn main() {} |