diff options
Diffstat (limited to 'tests/ui/codegen/freeze-on-polymorphic-projection.rs')
-rw-r--r-- | tests/ui/codegen/freeze-on-polymorphic-projection.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/codegen/freeze-on-polymorphic-projection.rs b/tests/ui/codegen/freeze-on-polymorphic-projection.rs new file mode 100644 index 000000000..edc79f8fd --- /dev/null +++ b/tests/ui/codegen/freeze-on-polymorphic-projection.rs @@ -0,0 +1,19 @@ +// build-pass +// compile-flags: -Copt-level=1 --crate-type=lib + +#![feature(specialization)] +//~^ WARN the feature `specialization` is incomplete + +pub unsafe trait Storage { + type Handle; +} + +pub unsafe trait MultipleStorage: Storage {} + +default unsafe impl<S> Storage for S where S: MultipleStorage {} + +// Make sure that we call is_freeze on `(S::Handle,)` in the param-env of `ice`, +// instead of in an empty, reveal-all param-env. +pub fn ice<S: Storage>(boxed: (S::Handle,)) -> (S::Handle,) { + boxed +} |