diff options
| author | Michael Goulet <michael@errs.io> | 2023-03-14 01:08:48 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-03-14 16:19:57 +0000 |
| commit | b36bbb0266a12f4869668f55aeaf4c8a68aa8265 (patch) | |
| tree | ecef360f7954bd864db93c863259c1ed47011110 /tests/ui/codegen | |
| parent | f1b1ed7e18f1fbe5226a96626827c625985f8285 (diff) | |
| download | rust-b36bbb0266a12f4869668f55aeaf4c8a68aa8265.tar.gz rust-b36bbb0266a12f4869668f55aeaf4c8a68aa8265.zip | |
Don't codegen impossible to satisfy impls
Diffstat (limited to 'tests/ui/codegen')
| -rw-r--r-- | tests/ui/codegen/mono-impossible.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/codegen/mono-impossible.rs b/tests/ui/codegen/mono-impossible.rs new file mode 100644 index 00000000000..1ea32ed2c4f --- /dev/null +++ b/tests/ui/codegen/mono-impossible.rs @@ -0,0 +1,13 @@ +// compile-flags: -Clink-dead-code=on --crate-type=lib +// build-pass + +// Make sure that we don't monomorphize the impossible method `<() as Visit>::visit`, +// which does not hold under a reveal-all param env. + +pub trait Visit { + fn visit() {} +} + +pub trait Array<'a> {} + +impl Visit for () where (): for<'a> Array<'a> {} |
