about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-01-20 23:37:42 +0100
committerGitHub <noreply@github.com>2022-01-20 23:37:42 +0100
commitb8df581ef855999fc409ed3c7e8f97d548ac05ad (patch)
tree7bf2435e6e883c878cdd627515095e0a7ea83f64
parent5e46f7dceb86b3dabd566750f7903d00f601a9c6 (diff)
parentc29b637875e837f63d726901cd727199b08a5264 (diff)
downloadrust-b8df581ef855999fc409ed3c7e8f97d548ac05ad.tar.gz
rust-b8df581ef855999fc409ed3c7e8f97d548ac05ad.zip
Rollup merge of #93114 - lcnr:mk_array, r=RalfJung
update comment for `ensure_monomorphic_enough`

r? `@RalfJung`
-rw-r--r--compiler/rustc_const_eval/src/interpret/util.rs6
-rw-r--r--compiler/rustc_typeck/src/check/writeback.rs2
2 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs
index 3dde34a6410..6a3378a3896 100644
--- a/compiler/rustc_const_eval/src/interpret/util.rs
+++ b/compiler/rustc_const_eval/src/interpret/util.rs
@@ -3,7 +3,11 @@ use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeVisitor};
 use std::convert::TryInto;
 use std::ops::ControlFlow;
 
-/// Returns `true` if a used generic parameter requires substitution.
+/// Checks whether a type contains generic parameters which require substitution.
+///
+/// In case it does, returns a `TooGeneric` const eval error. Note that due to polymorphization
+/// types may be "concrete enough" even though they still contain generic parameters in
+/// case these parameters are unused.
 crate fn ensure_monomorphic_enough<'tcx, T>(tcx: TyCtxt<'tcx>, ty: T) -> InterpResult<'tcx>
 where
     T: TypeFoldable<'tcx>,
diff --git a/compiler/rustc_typeck/src/check/writeback.rs b/compiler/rustc_typeck/src/check/writeback.rs
index f50f3c39c88..ec88bdf4a37 100644
--- a/compiler/rustc_typeck/src/check/writeback.rs
+++ b/compiler/rustc_typeck/src/check/writeback.rs
@@ -43,7 +43,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         let item_def_id = self.tcx.hir().local_def_id(item_id);
 
         // This attribute causes us to dump some writeback information
-        // in the form of errors, which is uSymbol for unit tests.
+        // in the form of errors, which is used for unit tests.
         let rustc_dump_user_substs =
             self.tcx.has_attr(item_def_id.to_def_id(), sym::rustc_dump_user_substs);