2016-07-11 09:52:37 -05:00
|
|
|
// This test ensures that attributes on formals in generic parameter
|
|
|
|
// lists are included when we are checking for unstable attributes.
|
|
|
|
|
|
|
|
struct StLt<#[lt_struct] 'a>(&'a u32);
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `lt_struct` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
struct StTy<#[ty_struct] I>(I);
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `ty_struct` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
|
|
|
|
enum EnLt<#[lt_enum] 'b> { A(&'b u32), B }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `lt_enum` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
enum EnTy<#[ty_enum] J> { A(J), B }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `ty_enum` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
|
|
|
|
trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `lt_trait` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `ty_trait` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
|
|
|
|
type TyLt<#[lt_type] 'd> = &'d u32;
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `lt_type` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
type TyTy<#[ty_type] L> = (L, );
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `ty_type` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
|
|
|
|
impl<#[lt_inherent] 'e> StLt<'e> { }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `lt_inherent` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
impl<#[ty_inherent] M> StTy<M> { }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `ty_inherent` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
|
|
|
|
impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `lt_impl_for` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
fn foo(&self, _: &'f [u32]) -> &'f u32 { loop { } }
|
|
|
|
}
|
|
|
|
impl<#[ty_impl_for] N> TrTy<N> for StTy<N> {
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `ty_impl_for` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
fn foo(&self, _: N) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `lt_fn` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
fn f_ty<#[ty_fn] O>(_: O) { }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `ty_fn` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
|
|
|
|
impl<I> StTy<I> {
|
|
|
|
fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `lt_meth` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
fn m_ty<#[ty_meth] P>(_: P) { }
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `ty_meth` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn hof_lt<Q>(_: Q)
|
|
|
|
where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32
|
2019-09-15 04:55:18 -05:00
|
|
|
//~^ ERROR cannot find attribute `lt_hof` in this scope
|
2016-07-11 09:52:37 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
}
|