]>
git.proxmox.com Git - rustc.git/blob - tests/ui/specialization/issue-40582.rs
4 // Should fail. Should not be possible to implement `make_static`.
6 #![feature(specialization)]
7 #![allow(incomplete_features)]
9 trait FromRef
<'a
, T
: ?Sized
> {
10 fn from_ref(r
: &'a T
) -> Self;
13 impl<'a
, T
: ?Sized
> FromRef
<'a
, T
> for &'a T
{
14 fn from_ref(r
: &'a T
) -> Self {
19 impl<'a
, T
: ?Sized
, R
> FromRef
<'a
, T
> for R
{
20 default fn from_ref(_
: &'a T
) -> Self {
25 fn make_static
<T
: ?Sized
>(data
: &T
) -> &'
static T
{
26 fn helper
<T
: ?Sized
, R
>(data
: &T
) -> R
{
33 let s
= "specialization".to_owned();
34 println
!("{:?}", make_static(s
.as_str()));