remove is_noop
This commit is contained in:
parent
2f004d2d40
commit
4bd571c4ff
4 changed files with 4 additions and 8 deletions
|
@ -90,7 +90,7 @@ macro call_intrinsic_match {
|
||||||
match $intrinsic {
|
match $intrinsic {
|
||||||
$(
|
$(
|
||||||
sym::$name => {
|
sym::$name => {
|
||||||
assert!($substs.is_noop());
|
assert!($substs.is_empty());
|
||||||
if let [$(ref $arg),*] = *$args {
|
if let [$(ref $arg),*] = *$args {
|
||||||
let ($($arg,)*) = (
|
let ($($arg,)*) = (
|
||||||
$(codegen_operand($fx, $arg),)*
|
$(codegen_operand($fx, $arg),)*
|
||||||
|
|
|
@ -275,10 +275,6 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_noop(&self) -> bool {
|
|
||||||
self.is_empty()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn types(&'a self) -> impl DoubleEndedIterator<Item = Ty<'tcx>> + 'a {
|
pub fn types(&'a self) -> impl DoubleEndedIterator<Item = Ty<'tcx>> + 'a {
|
||||||
self.iter()
|
self.iter()
|
||||||
|
|
|
@ -484,7 +484,7 @@ crate fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Option<St
|
||||||
let mut types_without_default_bounds = FxHashSet::default();
|
let mut types_without_default_bounds = FxHashSet::default();
|
||||||
let sized_trait = tcx.lang_items().sized_trait();
|
let sized_trait = tcx.lang_items().sized_trait();
|
||||||
|
|
||||||
if !substs.is_noop() {
|
if !substs.is_empty() {
|
||||||
types_without_default_bounds.extend(substs.types());
|
types_without_default_bounds.extend(substs.types());
|
||||||
w.push('<');
|
w.push('<');
|
||||||
w.push_str(
|
w.push_str(
|
||||||
|
|
|
@ -182,7 +182,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
// `foo.bar::<u32>(...)` -- the `Self` type here will be the
|
// `foo.bar::<u32>(...)` -- the `Self` type here will be the
|
||||||
// type of `foo` (possibly adjusted), but we don't want to
|
// type of `foo` (possibly adjusted), but we don't want to
|
||||||
// include that. We want just the `[_, u32]` part.
|
// include that. We want just the `[_, u32]` part.
|
||||||
if !method.substs.is_noop() {
|
if !method.substs.is_empty() {
|
||||||
let method_generics = self.tcx.generics_of(method.def_id);
|
let method_generics = self.tcx.generics_of(method.def_id);
|
||||||
if !method_generics.params.is_empty() {
|
if !method_generics.params.is_empty() {
|
||||||
let user_type_annotation = self.infcx.probe(|_| {
|
let user_type_annotation = self.infcx.probe(|_| {
|
||||||
|
@ -211,7 +211,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_substs(&self, node_id: hir::HirId, substs: SubstsRef<'tcx>) {
|
pub fn write_substs(&self, node_id: hir::HirId, substs: SubstsRef<'tcx>) {
|
||||||
if !substs.is_noop() {
|
if !substs.is_empty() {
|
||||||
debug!("write_substs({:?}, {:?}) in fcx {}", node_id, substs, self.tag());
|
debug!("write_substs({:?}, {:?}) in fcx {}", node_id, substs, self.tag());
|
||||||
|
|
||||||
self.typeck_results.borrow_mut().node_substs_mut().insert(node_id, substs);
|
self.typeck_results.borrow_mut().node_substs_mut().insert(node_id, substs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue