summaryrefslogtreecommitdiffstats
path: root/src/test/ui-fulldeps/internal-lints
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui-fulldeps/internal-lints
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/test/ui-fulldeps/internal-lints/bad_opt_access.rs22
-rw-r--r--src/test/ui-fulldeps/internal-lints/bad_opt_access.stderr20
-rw-r--r--src/test/ui-fulldeps/internal-lints/default_hash_types.rs29
-rw-r--r--src/test/ui-fulldeps/internal-lints/default_hash_types.stderr39
-rw-r--r--src/test/ui-fulldeps/internal-lints/diagnostics.rs73
-rw-r--r--src/test/ui-fulldeps/internal-lints/diagnostics.stderr44
-rw-r--r--src/test/ui-fulldeps/internal-lints/diagnostics_incorrect.rs15
-rw-r--r--src/test/ui-fulldeps/internal-lints/diagnostics_incorrect.stderr17
-rw-r--r--src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs11
-rw-r--r--src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr15
-rw-r--r--src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs46
-rw-r--r--src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr27
-rw-r--r--src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs35
-rw-r--r--src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.stderr20
-rw-r--r--src/test/ui-fulldeps/internal-lints/query_stability.rs24
-rw-r--r--src/test/ui-fulldeps/internal-lints/query_stability.stderr39
-rw-r--r--src/test/ui-fulldeps/internal-lints/query_stability_incorrect.rs15
-rw-r--r--src/test/ui-fulldeps/internal-lints/query_stability_incorrect.stderr17
-rw-r--r--src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.rs118
-rw-r--r--src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.stderr128
-rw-r--r--src/test/ui-fulldeps/internal-lints/rustc_pass_by_value_self.rs54
-rw-r--r--src/test/ui-fulldeps/internal-lints/rustc_pass_by_value_self.stderr38
-rw-r--r--src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs56
-rw-r--r--src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr214
24 files changed, 1116 insertions, 0 deletions
diff --git a/src/test/ui-fulldeps/internal-lints/bad_opt_access.rs b/src/test/ui-fulldeps/internal-lints/bad_opt_access.rs
new file mode 100644
index 000000000..d6bd6945e
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/bad_opt_access.rs
@@ -0,0 +1,22 @@
+// compile-flags: -Z unstable-options
+
+// Test that accessing command line options by field access triggers a lint for those fields
+// that have wrapper functions which should be used.
+
+#![crate_type = "lib"]
+#![feature(rustc_private)]
+#![deny(rustc::bad_opt_access)]
+
+extern crate rustc_session;
+use rustc_session::Session;
+
+pub fn access_bad_option(sess: Session) {
+ let _ = sess.opts.cg.split_debuginfo;
+ //~^ ERROR use `Session::split_debuginfo` instead of this field
+
+ let _ = sess.opts.crate_types;
+ //~^ ERROR use `Session::crate_types` instead of this field
+
+ let _ = sess.opts.crate_name;
+ // okay!
+}
diff --git a/src/test/ui-fulldeps/internal-lints/bad_opt_access.stderr b/src/test/ui-fulldeps/internal-lints/bad_opt_access.stderr
new file mode 100644
index 000000000..e4145bff8
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/bad_opt_access.stderr
@@ -0,0 +1,20 @@
+error: use `Session::split_debuginfo` instead of this field
+ --> $DIR/bad_opt_access.rs:14:13
+ |
+LL | let _ = sess.opts.cg.split_debuginfo;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/bad_opt_access.rs:8:9
+ |
+LL | #![deny(rustc::bad_opt_access)]
+ | ^^^^^^^^^^^^^^^^^^^^^
+
+error: use `Session::crate_types` instead of this field
+ --> $DIR/bad_opt_access.rs:17:13
+ |
+LL | let _ = sess.opts.crate_types;
+ | ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/default_hash_types.rs b/src/test/ui-fulldeps/internal-lints/default_hash_types.rs
new file mode 100644
index 000000000..795c7d2dc
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/default_hash_types.rs
@@ -0,0 +1,29 @@
+// compile-flags: -Z unstable-options
+
+#![feature(rustc_private)]
+#![deny(rustc::default_hash_types)]
+
+extern crate rustc_data_structures;
+
+use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use std::collections::{HashMap, HashSet};
+
+mod foo {
+ pub struct HashMap;
+}
+
+fn main() {
+ let _map: HashMap<String, String> = HashMap::default();
+ //~^ ERROR prefer `FxHashMap` over `HashMap`, it has better performance
+ //~^^ ERROR prefer `FxHashMap` over `HashMap`, it has better performance
+ let _set: HashSet<String> = HashSet::default();
+ //~^ ERROR prefer `FxHashSet` over `HashSet`, it has better performance
+ //~^^ ERROR prefer `FxHashSet` over `HashSet`, it has better performance
+
+ // test that the lint doesn't also match the Fx variants themselves
+ let _fx_map: FxHashMap<String, String> = FxHashMap::default();
+ let _fx_set: FxHashSet<String> = FxHashSet::default();
+
+ // test another struct of the same name
+ let _ = foo::HashMap;
+}
diff --git a/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr b/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr
new file mode 100644
index 000000000..9d13ee89b
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr
@@ -0,0 +1,39 @@
+error: prefer `FxHashMap` over `HashMap`, it has better performance
+ --> $DIR/default_hash_types.rs:16:41
+ |
+LL | let _map: HashMap<String, String> = HashMap::default();
+ | ^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/default_hash_types.rs:4:9
+ |
+LL | #![deny(rustc::default_hash_types)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
+
+error: prefer `FxHashMap` over `HashMap`, it has better performance
+ --> $DIR/default_hash_types.rs:16:15
+ |
+LL | let _map: HashMap<String, String> = HashMap::default();
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
+
+error: prefer `FxHashSet` over `HashSet`, it has better performance
+ --> $DIR/default_hash_types.rs:19:33
+ |
+LL | let _set: HashSet<String> = HashSet::default();
+ | ^^^^^^^
+ |
+ = note: a `use rustc_data_structures::fx::FxHashSet` may be necessary
+
+error: prefer `FxHashSet` over `HashSet`, it has better performance
+ --> $DIR/default_hash_types.rs:19:15
+ |
+LL | let _set: HashSet<String> = HashSet::default();
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: a `use rustc_data_structures::fx::FxHashSet` may be necessary
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.rs b/src/test/ui-fulldeps/internal-lints/diagnostics.rs
new file mode 100644
index 000000000..d6f63d44b
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/diagnostics.rs
@@ -0,0 +1,73 @@
+// compile-flags: -Z unstable-options
+
+#![crate_type = "lib"]
+#![feature(rustc_private)]
+#![deny(rustc::untranslatable_diagnostic)]
+#![deny(rustc::diagnostic_outside_of_impl)]
+
+extern crate rustc_errors;
+extern crate rustc_macros;
+extern crate rustc_session;
+extern crate rustc_span;
+
+use rustc_errors::{AddSubdiagnostic, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, fluent};
+use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic};
+use rustc_session::{parse::ParseSess, SessionDiagnostic};
+use rustc_span::Span;
+
+#[derive(SessionDiagnostic)]
+#[error(parser::expect_path)]
+struct DeriveSessionDiagnostic {
+ #[primary_span]
+ span: Span,
+}
+
+#[derive(SessionSubdiagnostic)]
+#[note(parser::add_paren)]
+struct Note {
+ #[primary_span]
+ span: Span,
+}
+
+pub struct UntranslatableInSessionDiagnostic;
+
+impl<'a> SessionDiagnostic<'a, ErrorGuaranteed> for UntranslatableInSessionDiagnostic {
+ fn into_diagnostic(self, sess: &'a ParseSess) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
+ sess.struct_err("untranslatable diagnostic")
+ //~^ ERROR diagnostics should be created using translatable messages
+ }
+}
+
+pub struct TranslatableInSessionDiagnostic;
+
+impl<'a> SessionDiagnostic<'a, ErrorGuaranteed> for TranslatableInSessionDiagnostic {
+ fn into_diagnostic(self, sess: &'a ParseSess) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
+ sess.struct_err(fluent::parser::expect_path)
+ }
+}
+
+pub struct UntranslatableInAddSubdiagnostic;
+
+impl AddSubdiagnostic for UntranslatableInAddSubdiagnostic {
+ fn add_to_diagnostic(self, diag: &mut Diagnostic) {
+ diag.note("untranslatable diagnostic");
+ //~^ ERROR diagnostics should be created using translatable messages
+ }
+}
+
+pub struct TranslatableInAddSubdiagnostic;
+
+impl AddSubdiagnostic for TranslatableInAddSubdiagnostic {
+ fn add_to_diagnostic(self, diag: &mut Diagnostic) {
+ diag.note(fluent::typeck::note);
+ }
+}
+
+pub fn make_diagnostics<'a>(sess: &'a ParseSess) {
+ let _diag = sess.struct_err(fluent::parser::expect_path);
+ //~^ ERROR diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
+
+ let _diag = sess.struct_err("untranslatable diagnostic");
+ //~^ ERROR diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
+ //~^^ ERROR diagnostics should be created using translatable messages
+}
diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr
new file mode 100644
index 000000000..bae78ffdc
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr
@@ -0,0 +1,44 @@
+error: diagnostics should be created using translatable messages
+ --> $DIR/diagnostics.rs:36:14
+ |
+LL | sess.struct_err("untranslatable diagnostic")
+ | ^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/diagnostics.rs:5:9
+ |
+LL | #![deny(rustc::untranslatable_diagnostic)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: diagnostics should be created using translatable messages
+ --> $DIR/diagnostics.rs:53:14
+ |
+LL | diag.note("untranslatable diagnostic");
+ | ^^^^
+
+error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
+ --> $DIR/diagnostics.rs:67:22
+ |
+LL | let _diag = sess.struct_err(fluent::parser::expect_path);
+ | ^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/diagnostics.rs:6:9
+ |
+LL | #![deny(rustc::diagnostic_outside_of_impl)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
+ --> $DIR/diagnostics.rs:70:22
+ |
+LL | let _diag = sess.struct_err("untranslatable diagnostic");
+ | ^^^^^^^^^^
+
+error: diagnostics should be created using translatable messages
+ --> $DIR/diagnostics.rs:70:22
+ |
+LL | let _diag = sess.struct_err("untranslatable diagnostic");
+ | ^^^^^^^^^^
+
+error: aborting due to 5 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics_incorrect.rs b/src/test/ui-fulldeps/internal-lints/diagnostics_incorrect.rs
new file mode 100644
index 000000000..99f99ffcd
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/diagnostics_incorrect.rs
@@ -0,0 +1,15 @@
+// compile-flags: -Z unstable-options
+
+#![feature(rustc_attrs)]
+
+#[rustc_lint_diagnostics]
+//~^ ERROR attribute should be applied to a function
+struct Foo;
+
+impl Foo {
+ #[rustc_lint_diagnostics(a)]
+ //~^ ERROR malformed `rustc_lint_diagnostics`
+ fn bar() {}
+}
+
+fn main() {}
diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics_incorrect.stderr b/src/test/ui-fulldeps/internal-lints/diagnostics_incorrect.stderr
new file mode 100644
index 000000000..e849ca282
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/diagnostics_incorrect.stderr
@@ -0,0 +1,17 @@
+error: malformed `rustc_lint_diagnostics` attribute input
+ --> $DIR/diagnostics_incorrect.rs:10:5
+ |
+LL | #[rustc_lint_diagnostics(a)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_lint_diagnostics]`
+
+error: attribute should be applied to a function definition
+ --> $DIR/diagnostics_incorrect.rs:5:1
+ |
+LL | #[rustc_lint_diagnostics]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | struct Foo;
+ | ----------- not a function definition
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs
new file mode 100644
index 000000000..7783dc40f
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.rs
@@ -0,0 +1,11 @@
+// compile-flags: -Z unstable-options
+
+#![feature(rustc_private)]
+#![feature(rustdoc_internals)]
+
+#![crate_type = "lib"]
+
+#![deny(rustc::existing_doc_keyword)]
+
+#[doc(keyword = "tadam")] //~ ERROR
+mod tadam {}
diff --git a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr
new file mode 100644
index 000000000..bc9fcdd7b
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr
@@ -0,0 +1,15 @@
+error: found non-existing keyword `tadam` used in `#[doc(keyword = \"...\")]`
+ --> $DIR/existing_doc_keyword.rs:10:1
+ |
+LL | #[doc(keyword = "tadam")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/existing_doc_keyword.rs:8:9
+ |
+LL | #![deny(rustc::existing_doc_keyword)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = help: only existing keywords are allowed in core/std
+
+error: aborting due to previous error
+
diff --git a/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs
new file mode 100644
index 000000000..f6f0c0385
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs
@@ -0,0 +1,46 @@
+// compile-flags: -Z unstable-options
+
+#![feature(rustc_private)]
+#![deny(rustc::lint_pass_impl_without_macro)]
+
+extern crate rustc_middle;
+extern crate rustc_session;
+
+use rustc_session::lint::{LintArray, LintPass};
+use rustc_session::{declare_lint, declare_lint_pass, impl_lint_pass};
+
+declare_lint! {
+ pub TEST_LINT,
+ Allow,
+ "test"
+}
+
+struct Foo;
+
+impl LintPass for Foo { //~ERROR implementing `LintPass` by hand
+ fn name(&self) -> &'static str {
+ "Foo"
+ }
+}
+
+macro_rules! custom_lint_pass_macro {
+ () => {
+ struct Custom;
+
+ impl LintPass for Custom { //~ERROR implementing `LintPass` by hand
+ fn name(&self) -> &'static str {
+ "Custom"
+ }
+ }
+ };
+}
+
+custom_lint_pass_macro!();
+
+struct Bar;
+
+impl_lint_pass!(Bar => [TEST_LINT]);
+
+declare_lint_pass!(Baz => [TEST_LINT]);
+
+fn main() {}
diff --git a/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr
new file mode 100644
index 000000000..9df6be65e
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr
@@ -0,0 +1,27 @@
+error: implementing `LintPass` by hand
+ --> $DIR/lint_pass_impl_without_macro.rs:20:6
+ |
+LL | impl LintPass for Foo {
+ | ^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint_pass_impl_without_macro.rs:4:9
+ |
+LL | #![deny(rustc::lint_pass_impl_without_macro)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = help: try using `declare_lint_pass!` or `impl_lint_pass!` instead
+
+error: implementing `LintPass` by hand
+ --> $DIR/lint_pass_impl_without_macro.rs:30:14
+ |
+LL | impl LintPass for Custom {
+ | ^^^^^^^^
+...
+LL | custom_lint_pass_macro!();
+ | ------------------------- in this macro invocation
+ |
+ = help: try using `declare_lint_pass!` or `impl_lint_pass!` instead
+ = note: this error originates in the macro `custom_lint_pass_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs b/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs
new file mode 100644
index 000000000..32b987338
--- /dev/null
+++ b/src/test/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);
+}
diff --git a/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.stderr b/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.stderr
new file mode 100644
index 000000000..a1056cf85
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.stderr
@@ -0,0 +1,20 @@
+error: usage of qualified `ty::Ty<'_>`
+ --> $DIR/qualified_ty_ty_ctxt.rs:25:11
+ |
+LL | ty_q: ty::Ty<'_>,
+ | ^^^^^^^^^^ help: try importing it and using it unqualified: `Ty<'_>`
+ |
+note: the lint level is defined here
+ --> $DIR/qualified_ty_ty_ctxt.rs:4:9
+ |
+LL | #![deny(rustc::usage_of_qualified_ty)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: usage of qualified `ty::TyCtxt<'_>`
+ --> $DIR/qualified_ty_ty_ctxt.rs:27:16
+ |
+LL | ty_ctxt_q: ty::TyCtxt<'_>,
+ | ^^^^^^^^^^^^^^ help: try importing it and using it unqualified: `TyCtxt<'_>`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/query_stability.rs b/src/test/ui-fulldeps/internal-lints/query_stability.rs
new file mode 100644
index 000000000..560675b44
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/query_stability.rs
@@ -0,0 +1,24 @@
+// compile-flags: -Z unstable-options
+
+#![feature(rustc_private)]
+#![deny(rustc::potential_query_instability)]
+
+extern crate rustc_data_structures;
+
+use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+
+fn main() {
+ let mut x = FxHashMap::<u32, i32>::default();
+
+ for _ in x.drain() {}
+ //~^ ERROR using `drain` can result in unstable
+
+ for _ in x.iter() {}
+ //~^ ERROR using `iter`
+
+ for _ in Some(&mut x).unwrap().iter_mut() {}
+ //~^ ERROR using `iter_mut`
+
+ for _ in x {}
+ //~^ ERROR using `into_iter`
+}
diff --git a/src/test/ui-fulldeps/internal-lints/query_stability.stderr b/src/test/ui-fulldeps/internal-lints/query_stability.stderr
new file mode 100644
index 000000000..7e8b448f4
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/query_stability.stderr
@@ -0,0 +1,39 @@
+error: using `drain` can result in unstable query results
+ --> $DIR/query_stability.rs:13:16
+ |
+LL | for _ in x.drain() {}
+ | ^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/query_stability.rs:4:9
+ |
+LL | #![deny(rustc::potential_query_instability)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
+
+error: using `iter` can result in unstable query results
+ --> $DIR/query_stability.rs:16:16
+ |
+LL | for _ in x.iter() {}
+ | ^^^^
+ |
+ = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
+
+error: using `iter_mut` can result in unstable query results
+ --> $DIR/query_stability.rs:19:36
+ |
+LL | for _ in Some(&mut x).unwrap().iter_mut() {}
+ | ^^^^^^^^
+ |
+ = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
+
+error: using `into_iter` can result in unstable query results
+ --> $DIR/query_stability.rs:22:14
+ |
+LL | for _ in x {}
+ | ^
+ |
+ = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.rs b/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.rs
new file mode 100644
index 000000000..f478b7332
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.rs
@@ -0,0 +1,15 @@
+// compile-flags: -Z unstable-options
+
+#![feature(rustc_attrs)]
+
+#[rustc_lint_query_instability]
+//~^ ERROR attribute should be applied to a function
+struct Foo;
+
+impl Foo {
+ #[rustc_lint_query_instability(a)]
+ //~^ ERROR malformed `rustc_lint_query_instability`
+ fn bar() {}
+}
+
+fn main() {}
diff --git a/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.stderr b/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.stderr
new file mode 100644
index 000000000..3f78b39ed
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.stderr
@@ -0,0 +1,17 @@
+error: malformed `rustc_lint_query_instability` attribute input
+ --> $DIR/query_stability_incorrect.rs:10:5
+ |
+LL | #[rustc_lint_query_instability(a)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_lint_query_instability]`
+
+error: attribute should be applied to a function definition
+ --> $DIR/query_stability_incorrect.rs:5:1
+ |
+LL | #[rustc_lint_query_instability]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | struct Foo;
+ | ----------- not a function definition
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.rs b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.rs
new file mode 100644
index 000000000..10bab2d88
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.rs
@@ -0,0 +1,118 @@
+// compile-flags: -Z unstable-options
+
+#![feature(rustc_attrs)]
+#![feature(rustc_private)]
+#![deny(rustc::pass_by_value)]
+#![allow(unused)]
+
+extern crate rustc_middle;
+
+use rustc_middle::ty::{Ty, TyCtxt};
+
+fn ty_by_ref(
+ ty_val: Ty<'_>,
+ ty_ref: &Ty<'_>, //~ ERROR passing `Ty<'_>` by reference
+ ty_ctxt_val: TyCtxt<'_>,
+ ty_ctxt_ref: &TyCtxt<'_>, //~ ERROR passing `TyCtxt<'_>` by reference
+) {
+}
+
+fn ty_multi_ref(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
+//~^ ERROR passing `Ty<'_>` by reference
+//~^^ ERROR passing `TyCtxt<'_>` by reference
+
+trait T {
+ fn ty_by_ref_in_trait(
+ ty_val: Ty<'_>,
+ ty_ref: &Ty<'_>, //~ ERROR passing `Ty<'_>` by reference
+ ty_ctxt_val: TyCtxt<'_>,
+ ty_ctxt_ref: &TyCtxt<'_>, //~ ERROR passing `TyCtxt<'_>` by reference
+ );
+
+ fn ty_multi_ref_in_trait(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>);
+ //~^ ERROR passing `Ty<'_>` by reference
+ //~^^ ERROR passing `TyCtxt<'_>` by reference
+}
+
+struct Foo;
+
+impl T for Foo {
+ fn ty_by_ref_in_trait(
+ ty_val: Ty<'_>,
+ ty_ref: &Ty<'_>,
+ ty_ctxt_val: TyCtxt<'_>,
+ ty_ctxt_ref: &TyCtxt<'_>,
+ ) {
+ }
+
+ fn ty_multi_ref_in_trait(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
+}
+
+impl Foo {
+ fn ty_by_ref_assoc(
+ ty_val: Ty<'_>,
+ ty_ref: &Ty<'_>, //~ ERROR passing `Ty<'_>` by reference
+ ty_ctxt_val: TyCtxt<'_>,
+ ty_ctxt_ref: &TyCtxt<'_>, //~ ERROR passing `TyCtxt<'_>` by reference
+ ) {
+ }
+
+ fn ty_multi_ref_assoc(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
+ //~^ ERROR passing `Ty<'_>` by reference
+ //~^^ ERROR passing `TyCtxt<'_>` by reference
+}
+
+#[rustc_pass_by_value]
+enum CustomEnum {
+ A,
+ B,
+}
+
+impl CustomEnum {
+ fn test(
+ value: CustomEnum,
+ reference: &CustomEnum, //~ ERROR passing `CustomEnum` by reference
+ ) {
+ }
+}
+
+#[rustc_pass_by_value]
+struct CustomStruct {
+ s: u8,
+}
+
+#[rustc_pass_by_value]
+type CustomAlias<'a> = &'a CustomStruct; //~ ERROR passing `CustomStruct` by reference
+
+impl CustomStruct {
+ fn test(
+ value: CustomStruct,
+ reference: &CustomStruct, //~ ERROR passing `CustomStruct` by reference
+ ) {
+ }
+
+ fn test_alias(
+ value: CustomAlias,
+ reference: &CustomAlias, //~ ERROR passing `CustomAlias<'_>` by reference
+ ) {
+ }
+}
+
+#[rustc_pass_by_value]
+struct WithParameters<T, const N: usize, M = u32> {
+ slice: [T; N],
+ m: M,
+}
+
+impl<T> WithParameters<T, 1> {
+ fn test<'a>(
+ value: WithParameters<T, 1>,
+ reference: &'a WithParameters<T, 1>, //~ ERROR passing `WithParameters<T, 1>` by reference
+ reference_with_m: &WithParameters<T, 1, u32>, //~ ERROR passing `WithParameters<T, 1, u32>` by reference
+ ) -> &'a WithParameters<T, 1> {
+ //~^ ERROR passing `WithParameters<T, 1>` by reference
+ reference as &WithParameters<_, 1> //~ ERROR passing `WithParameters<_, 1>` by reference
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.stderr b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.stderr
new file mode 100644
index 000000000..69cf20656
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.stderr
@@ -0,0 +1,128 @@
+error: passing `Ty<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:14:13
+ |
+LL | ty_ref: &Ty<'_>,
+ | ^^^^^^^ help: try passing by value: `Ty<'_>`
+ |
+note: the lint level is defined here
+ --> $DIR/rustc_pass_by_value.rs:5:9
+ |
+LL | #![deny(rustc::pass_by_value)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: passing `TyCtxt<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:16:18
+ |
+LL | ty_ctxt_ref: &TyCtxt<'_>,
+ | ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
+
+error: passing `Ty<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:20:28
+ |
+LL | fn ty_multi_ref(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
+ | ^^^^^^^ help: try passing by value: `Ty<'_>`
+
+error: passing `TyCtxt<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:20:55
+ |
+LL | fn ty_multi_ref(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
+ | ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
+
+error: passing `Ty<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:27:17
+ |
+LL | ty_ref: &Ty<'_>,
+ | ^^^^^^^ help: try passing by value: `Ty<'_>`
+
+error: passing `TyCtxt<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:29:22
+ |
+LL | ty_ctxt_ref: &TyCtxt<'_>,
+ | ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
+
+error: passing `Ty<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:32:41
+ |
+LL | fn ty_multi_ref_in_trait(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>);
+ | ^^^^^^^ help: try passing by value: `Ty<'_>`
+
+error: passing `TyCtxt<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:32:68
+ |
+LL | fn ty_multi_ref_in_trait(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>);
+ | ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
+
+error: passing `Ty<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:54:17
+ |
+LL | ty_ref: &Ty<'_>,
+ | ^^^^^^^ help: try passing by value: `Ty<'_>`
+
+error: passing `TyCtxt<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:56:22
+ |
+LL | ty_ctxt_ref: &TyCtxt<'_>,
+ | ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
+
+error: passing `Ty<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:60:38
+ |
+LL | fn ty_multi_ref_assoc(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
+ | ^^^^^^^ help: try passing by value: `Ty<'_>`
+
+error: passing `TyCtxt<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:60:65
+ |
+LL | fn ty_multi_ref_assoc(ty_multi: &&Ty<'_>, ty_ctxt_multi: &&&&TyCtxt<'_>) {}
+ | ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`
+
+error: passing `CustomEnum` by reference
+ --> $DIR/rustc_pass_by_value.rs:74:20
+ |
+LL | reference: &CustomEnum,
+ | ^^^^^^^^^^^ help: try passing by value: `CustomEnum`
+
+error: passing `CustomStruct` by reference
+ --> $DIR/rustc_pass_by_value.rs:85:24
+ |
+LL | type CustomAlias<'a> = &'a CustomStruct;
+ | ^^^^^^^^^^^^^^^^ help: try passing by value: `CustomStruct`
+
+error: passing `CustomStruct` by reference
+ --> $DIR/rustc_pass_by_value.rs:90:20
+ |
+LL | reference: &CustomStruct,
+ | ^^^^^^^^^^^^^ help: try passing by value: `CustomStruct`
+
+error: passing `CustomAlias<'_>` by reference
+ --> $DIR/rustc_pass_by_value.rs:96:20
+ |
+LL | reference: &CustomAlias,
+ | ^^^^^^^^^^^^ help: try passing by value: `CustomAlias<'_>`
+
+error: passing `WithParameters<T, 1>` by reference
+ --> $DIR/rustc_pass_by_value.rs:110:20
+ |
+LL | reference: &'a WithParameters<T, 1>,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try passing by value: `WithParameters<T, 1>`
+
+error: passing `WithParameters<T, 1, u32>` by reference
+ --> $DIR/rustc_pass_by_value.rs:111:27
+ |
+LL | reference_with_m: &WithParameters<T, 1, u32>,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try passing by value: `WithParameters<T, 1, u32>`
+
+error: passing `WithParameters<T, 1>` by reference
+ --> $DIR/rustc_pass_by_value.rs:112:10
+ |
+LL | ) -> &'a WithParameters<T, 1> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try passing by value: `WithParameters<T, 1>`
+
+error: passing `WithParameters<_, 1>` by reference
+ --> $DIR/rustc_pass_by_value.rs:114:22
+ |
+LL | reference as &WithParameters<_, 1>
+ | ^^^^^^^^^^^^^^^^^^^^^ help: try passing by value: `WithParameters<_, 1>`
+
+error: aborting due to 20 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value_self.rs b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value_self.rs
new file mode 100644
index 000000000..6ce67dcaf
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value_self.rs
@@ -0,0 +1,54 @@
+// compile-flags: -Z unstable-options
+// NOTE: This test doesn't actually require `fulldeps`
+// so we could instead use it as a `ui` test.
+//
+// Considering that all other `internal-lints` are tested here
+// this seems like the cleaner solution though.
+#![feature(rustc_attrs)]
+#![deny(rustc::pass_by_value)]
+#![allow(unused)]
+
+#[rustc_pass_by_value]
+struct TyCtxt<'tcx> {
+ inner: &'tcx (),
+}
+
+impl<'tcx> TyCtxt<'tcx> {
+ fn by_value(self) {} // OK
+ fn by_ref(&self) {} //~ ERROR passing `TyCtxt<'tcx>` by reference
+}
+
+struct TyS<'tcx> {
+ inner: &'tcx (),
+}
+
+#[rustc_pass_by_value]
+type Ty<'tcx> = &'tcx TyS<'tcx>;
+
+impl<'tcx> TyS<'tcx> {
+ fn by_value(self: Ty<'tcx>) {}
+ fn by_ref(self: &Ty<'tcx>) {} //~ ERROR passing `Ty<'tcx>` by reference
+}
+
+#[rustc_pass_by_value]
+struct Foo;
+
+impl Foo {
+ fn with_ref(&self) {} //~ ERROR passing `Foo` by reference
+}
+
+#[rustc_pass_by_value]
+struct WithParameters<T, const N: usize, M = u32> {
+ slice: [T; N],
+ m: M,
+}
+
+impl<T> WithParameters<T, 1> {
+ fn with_ref(&self) {} //~ ERROR passing `WithParameters<T, 1>` by reference
+}
+
+impl<T> WithParameters<T, 1, u8> {
+ fn with_ref(&self) {} //~ ERROR passing `WithParameters<T, 1, u8>` by reference
+}
+
+fn main() {}
diff --git a/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value_self.stderr b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value_self.stderr
new file mode 100644
index 000000000..fb39ed60b
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value_self.stderr
@@ -0,0 +1,38 @@
+error: passing `TyCtxt<'tcx>` by reference
+ --> $DIR/rustc_pass_by_value_self.rs:18:15
+ |
+LL | fn by_ref(&self) {}
+ | ^^^^^ help: try passing by value: `TyCtxt<'tcx>`
+ |
+note: the lint level is defined here
+ --> $DIR/rustc_pass_by_value_self.rs:8:9
+ |
+LL | #![deny(rustc::pass_by_value)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: passing `Ty<'tcx>` by reference
+ --> $DIR/rustc_pass_by_value_self.rs:30:21
+ |
+LL | fn by_ref(self: &Ty<'tcx>) {}
+ | ^^^^^^^^^ help: try passing by value: `Ty<'tcx>`
+
+error: passing `Foo` by reference
+ --> $DIR/rustc_pass_by_value_self.rs:37:17
+ |
+LL | fn with_ref(&self) {}
+ | ^^^^^ help: try passing by value: `Foo`
+
+error: passing `WithParameters<T, 1>` by reference
+ --> $DIR/rustc_pass_by_value_self.rs:47:17
+ |
+LL | fn with_ref(&self) {}
+ | ^^^^^ help: try passing by value: `WithParameters<T, 1>`
+
+error: passing `WithParameters<T, 1, u8>` by reference
+ --> $DIR/rustc_pass_by_value_self.rs:51:17
+ |
+LL | fn with_ref(&self) {}
+ | ^^^^^ help: try passing by value: `WithParameters<T, 1, u8>`
+
+error: aborting due to 5 previous errors
+
diff --git a/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs
new file mode 100644
index 000000000..2cb1ed6fc
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs
@@ -0,0 +1,56 @@
+// compile-flags: -Z unstable-options
+
+#![feature(rustc_private)]
+
+extern crate rustc_middle;
+extern crate rustc_type_ir;
+
+use rustc_middle::ty::{self, Ty, TyKind};
+use rustc_type_ir::{Interner, TyKind as IrTyKind};
+
+#[deny(rustc::usage_of_ty_tykind)]
+fn main() {
+ let kind = TyKind::Bool; //~ ERROR usage of `ty::TyKind::<kind>`
+
+ match kind {
+ TyKind::Bool => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Char => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Int(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Uint(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Float(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Adt(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Foreign(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Str => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Array(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Slice(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::RawPtr(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Ref(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::FnDef(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::FnPtr(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Dynamic(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Closure(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Generator(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::GeneratorWitness(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Never => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Tuple(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Projection(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Opaque(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Param(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Bound(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Placeholder(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Infer(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ TyKind::Error(_) => (), //~ ERROR usage of `ty::TyKind::<kind>`
+ }
+
+ if let ty::Int(int_ty) = kind {}
+
+ if let TyKind::Int(int_ty) = kind {} //~ ERROR usage of `ty::TyKind::<kind>`
+
+ fn ty_kind(ty_bad: TyKind<'_>, ty_good: Ty<'_>) {} //~ ERROR usage of `ty::TyKind`
+
+ fn ir_ty_kind<I: Interner>(bad: IrTyKind<I>) -> IrTyKind<I> {
+ //~^ ERROR usage of `ty::TyKind`
+ //~| ERROR usage of `ty::TyKind`
+ IrTyKind::Bool //~ ERROR usage of `ty::TyKind::<kind>`
+ }
+}
diff --git a/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr
new file mode 100644
index 000000000..171f49087
--- /dev/null
+++ b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr
@@ -0,0 +1,214 @@
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:13:16
+ |
+LL | let kind = TyKind::Bool;
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+ |
+note: the lint level is defined here
+ --> $DIR/ty_tykind_usage.rs:11:8
+ |
+LL | #[deny(rustc::usage_of_ty_tykind)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:16:9
+ |
+LL | TyKind::Bool => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:17:9
+ |
+LL | TyKind::Char => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:18:9
+ |
+LL | TyKind::Int(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:19:9
+ |
+LL | TyKind::Uint(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:20:9
+ |
+LL | TyKind::Float(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:21:9
+ |
+LL | TyKind::Adt(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:22:9
+ |
+LL | TyKind::Foreign(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:23:9
+ |
+LL | TyKind::Str => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:24:9
+ |
+LL | TyKind::Array(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:25:9
+ |
+LL | TyKind::Slice(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:26:9
+ |
+LL | TyKind::RawPtr(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:27:9
+ |
+LL | TyKind::Ref(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:28:9
+ |
+LL | TyKind::FnDef(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:29:9
+ |
+LL | TyKind::FnPtr(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:30:9
+ |
+LL | TyKind::Dynamic(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:31:9
+ |
+LL | TyKind::Closure(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:32:9
+ |
+LL | TyKind::Generator(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:33:9
+ |
+LL | TyKind::GeneratorWitness(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:34:9
+ |
+LL | TyKind::Never => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:35:9
+ |
+LL | TyKind::Tuple(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:36:9
+ |
+LL | TyKind::Projection(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:37:9
+ |
+LL | TyKind::Opaque(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:38:9
+ |
+LL | TyKind::Param(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:39:9
+ |
+LL | TyKind::Bound(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:40:9
+ |
+LL | TyKind::Placeholder(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:41:9
+ |
+LL | TyKind::Infer(..) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:42:9
+ |
+LL | TyKind::Error(_) => (),
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:47:12
+ |
+LL | if let TyKind::Int(int_ty) = kind {}
+ | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+
+error: usage of `ty::TyKind`
+ --> $DIR/ty_tykind_usage.rs:49:24
+ |
+LL | fn ty_kind(ty_bad: TyKind<'_>, ty_good: Ty<'_>) {}
+ | ^^^^^^^^^^
+ |
+ = help: try using `Ty` instead
+
+error: usage of `ty::TyKind`
+ --> $DIR/ty_tykind_usage.rs:51:37
+ |
+LL | fn ir_ty_kind<I: Interner>(bad: IrTyKind<I>) -> IrTyKind<I> {
+ | ^^^^^^^^^^^
+ |
+ = help: try using `Ty` instead
+
+error: usage of `ty::TyKind`
+ --> $DIR/ty_tykind_usage.rs:51:53
+ |
+LL | fn ir_ty_kind<I: Interner>(bad: IrTyKind<I>) -> IrTyKind<I> {
+ | ^^^^^^^^^^^
+ |
+ = help: try using `Ty` instead
+
+error: usage of `ty::TyKind::<kind>`
+ --> $DIR/ty_tykind_usage.rs:54:9
+ |
+LL | IrTyKind::Bool
+ | --------^^^^^^
+ | |
+ | help: try using `ty::<kind>` directly: `ty`
+
+error: aborting due to 33 previous errors
+