summaryrefslogtreecommitdiffstats
path: root/tests/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs
blob: 32b987338c057f1ecabf59fef7e1a40de47cb4cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// compile-flags: -Z unstable-options

#![feature(rustc_private)]
#![deny(rustc::usage_of_qualified_ty)]
#![allow(unused)]

extern crate rustc_middle;

use rustc_middle::ty::{self, Ty, TyCtxt};

macro_rules! qualified_macro {
    ($a:ident) => {
        fn ty_in_macro(
            ty_q: ty::Ty<'_>,
            ty: Ty<'_>,
            ty_ctxt_q: ty::TyCtxt<'_>,
            ty_ctxt: TyCtxt<'_>,
        ) {
            println!("{}", stringify!($a));
        }
    };
}

fn ty_qualified(
    ty_q: ty::Ty<'_>, //~ ERROR usage of qualified `ty::Ty<'_>`
    ty: Ty<'_>,
    ty_ctxt_q: ty::TyCtxt<'_>, //~ ERROR usage of qualified `ty::TyCtxt<'_>`
    ty_ctxt: TyCtxt<'_>,
) {
}


fn main() {
    qualified_macro!(a);
}