diff options
Diffstat (limited to 'tests/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs')
-rw-r--r-- | tests/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs b/tests/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs new file mode 100644 index 000000000..32b987338 --- /dev/null +++ b/tests/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs @@ -0,0 +1,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); +} |