about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty
diff options
context:
space:
mode:
authorAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>2023-10-18 14:24:52 +0300
committerGitHub <noreply@github.com>2023-10-18 14:24:52 +0300
commit42e5f415fee35718bed4699a5d3faa5c2cb2a452 (patch)
tree4732328f9688b0c20a1cde80b3bf92ad4f9b34c5 /compiler/rustc_middle/src/ty
parentd69cdb2ceb58489dc0f5eaa7ee1f1b5e29bbc0d5 (diff)
parent9917ef9a6674619a72c16efaf1ca3777730d0012 (diff)
downloadrust-42e5f415fee35718bed4699a5d3faa5c2cb2a452.tar.gz
rust-42e5f415fee35718bed4699a5d3faa5c2cb2a452.zip
Rollup merge of #116870 - compiler-errors:host-param-by-name, r=fee1-dead
Don't compare host param by name

Seems sketchy to be searching for `sym::host` by name, especially when we can get the actual index with not very much work.

r? fee1-dead
Diffstat (limited to 'compiler/rustc_middle/src/ty')
-rw-r--r--compiler/rustc_middle/src/ty/generic_args.rs5
1 files changed, 0 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/ty/generic_args.rs b/compiler/rustc_middle/src/ty/generic_args.rs
index 72390e4bbb0..a861af47859 100644
--- a/compiler/rustc_middle/src/ty/generic_args.rs
+++ b/compiler/rustc_middle/src/ty/generic_args.rs
@@ -11,7 +11,6 @@ use rustc_errors::{DiagnosticArgValue, IntoDiagnosticArg};
 use rustc_hir::def_id::DefId;
 use rustc_macros::HashStable;
 use rustc_serialize::{self, Decodable, Encodable};
-use rustc_span::sym;
 use rustc_type_ir::WithCachedTypeInfo;
 use smallvec::SmallVec;
 
@@ -452,10 +451,6 @@ impl<'tcx> GenericArgs<'tcx> {
         tcx.mk_args_from_iter(self.iter().take(generics.count()))
     }
 
-    pub fn host_effect_param(&'tcx self) -> Option<ty::Const<'tcx>> {
-        self.consts().rfind(|x| matches!(x.kind(), ty::ConstKind::Param(p) if p.name == sym::host))
-    }
-
     pub fn print_as_list(&self) -> String {
         let v = self.iter().map(|arg| arg.to_string()).collect::<Vec<_>>();
         format!("[{}]", v.join(", "))