diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2020-11-23 07:42:06 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2021-09-17 12:47:48 -0400 |
| commit | ebb8ff9edfe0a908be55fc8c7852f291cc57f62a (patch) | |
| tree | 0f580300c716a120d77f2bba9b95fa588e260166 /compiler/rustc_infer | |
| parent | 2ee89144e21c10a95b411ff72235da6e29c04a94 (diff) | |
| download | rust-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.rs | 6 |
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, } |
