about summary refs log tree commit diff
path: root/compiler/rustc_infer
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2020-11-23 07:42:06 -0500
committerMark Rousskov <mark.simulacrum@gmail.com>2021-09-17 12:47:48 -0400
commitebb8ff9edfe0a908be55fc8c7852f291cc57f62a (patch)
tree0f580300c716a120d77f2bba9b95fa588e260166 /compiler/rustc_infer
parent2ee89144e21c10a95b411ff72235da6e29c04a94 (diff)
downloadrust-ebb8ff9edfe0a908be55fc8c7852f291cc57f62a.tar.gz
rust-ebb8ff9edfe0a908be55fc8c7852f291cc57f62a.zip
remove diverging type variables from fn check
The comment seems incorrect. Testing revealed that the examples in
question still work (as well as some variants) even without the
special casing here.
Diffstat (limited to 'compiler/rustc_infer')
-rw-r--r--compiler/rustc_infer/src/infer/type_variable.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_infer/src/infer/type_variable.rs b/compiler/rustc_infer/src/infer/type_variable.rs
index f15268f6895..071cf6e1ea4 100644
--- a/compiler/rustc_infer/src/infer/type_variable.rs
+++ b/compiler/rustc_infer/src/infer/type_variable.rs
@@ -129,7 +129,11 @@ pub enum TypeVariableOriginKind {
     SubstitutionPlaceholder,
     AutoDeref,
     AdjustmentType,
-    DivergingFn,
+
+    /// In type check, when we are type checking a function that
+    /// returns `-> dyn Foo`, we substitute a type variable for the
+    /// return type for diagnostic purposes.
+    DynReturnFn,
     LatticeVariable,
 }