summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_middle/src/ty/generic_args.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /compiler/rustc_middle/src/ty/generic_args.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_middle/src/ty/generic_args.rs')
-rw-r--r--compiler/rustc_middle/src/ty/generic_args.rs19
1 files changed, 7 insertions, 12 deletions
diff --git a/compiler/rustc_middle/src/ty/generic_args.rs b/compiler/rustc_middle/src/ty/generic_args.rs
index 72390e4bb..41a1bf04e 100644
--- a/compiler/rustc_middle/src/ty/generic_args.rs
+++ b/compiler/rustc_middle/src/ty/generic_args.rs
@@ -2,7 +2,7 @@
use crate::ty::codec::{TyDecoder, TyEncoder};
use crate::ty::fold::{FallibleTypeFolder, TypeFoldable, TypeFolder, TypeSuperFoldable};
-use crate::ty::sty::{ClosureArgs, GeneratorArgs, InlineConstArgs};
+use crate::ty::sty::{ClosureArgs, CoroutineArgs, InlineConstArgs};
use crate::ty::visit::{TypeVisitable, TypeVisitableExt, TypeVisitor};
use crate::ty::{self, Lift, List, ParamConst, Ty, TyCtxt};
@@ -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;
@@ -267,12 +266,12 @@ impl<'tcx> GenericArgs<'tcx> {
ClosureArgs { args: self }
}
- /// Interpret these generic args as the args of a generator type.
- /// Generator args have a particular structure controlled by the
- /// compiler that encodes information like the signature and generator kind;
- /// see `ty::GeneratorArgs` struct for more comments.
- pub fn as_generator(&'tcx self) -> GeneratorArgs<'tcx> {
- GeneratorArgs { args: self }
+ /// Interpret these generic args as the args of a coroutine type.
+ /// Coroutine args have a particular structure controlled by the
+ /// compiler that encodes information like the signature and coroutine kind;
+ /// see `ty::CoroutineArgs` struct for more comments.
+ pub fn as_coroutine(&'tcx self) -> CoroutineArgs<'tcx> {
+ CoroutineArgs { args: self }
}
/// Interpret these generic args as the args of an inline const.
@@ -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(", "))