rust/tests/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs

36 lines
718 B
Rust
Raw Normal View History

2019-04-24 16:23:44 -05:00
// compile-flags: -Z unstable-options
#![feature(rustc_private)]
2019-06-24 03:43:51 -05:00
#![deny(rustc::usage_of_qualified_ty)]
2019-04-24 16:23:44 -05:00
#![allow(unused)]
extern crate rustc_middle;
2019-04-24 16:23:44 -05:00
use rustc_middle::ty::{self, Ty, TyCtxt};
2019-04-24 16:23:44 -05:00
macro_rules! qualified_macro {
($a:ident) => {
fn ty_in_macro(
ty_q: ty::Ty<'_>,
ty: Ty<'_>,
2019-06-13 16:48:52 -05:00
ty_ctxt_q: ty::TyCtxt<'_>,
ty_ctxt: TyCtxt<'_>,
2019-04-24 16:23:44 -05:00
) {
println!("{}", stringify!($a));
}
};
}
fn ty_qualified(
ty_q: ty::Ty<'_>, //~ ERROR usage of qualified `ty::Ty<'_>`
ty: Ty<'_>,
2019-06-13 16:48:52 -05:00
ty_ctxt_q: ty::TyCtxt<'_>, //~ ERROR usage of qualified `ty::TyCtxt<'_>`
ty_ctxt: TyCtxt<'_>,
2019-04-24 16:23:44 -05:00
) {
}
fn main() {
qualified_macro!(a);
}