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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
719 B
Rust
Raw Normal View History

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