Prevent at compile time converting from Error::success() to Expected<T>

This would trigger an assertion at runtime otherwise.

Differential Revision: https://reviews.llvm.org/D26482

llvm-svn: 286562
diff --git a/lldb/source/Utility/ModuleCache.cpp b/lldb/source/Utility/ModuleCache.cpp
index c53be90..889cd8f 100644
--- a/lldb/source/Utility/ModuleCache.cpp
+++ b/lldb/source/Utility/ModuleCache.cpp
@@ -70,7 +70,7 @@
     if (!dir_path.IsDirectory())
       return Error("Invalid existing path");
 
-    return Error::success();
+    return Error();
   }
 
   return FileSystem::MakeDirectory(dir_path, eFilePermissionsDirectoryDefault);
@@ -141,7 +141,7 @@
                platform_module_spec.GetPath().c_str());
   if (sysroot_module_path_spec.Exists()) {
     if (!delete_existing)
-      return Error::success();
+      return Error();
 
     DecrementRefExistingModule(root_dir_spec, sysroot_module_path_spec);
   }
@@ -210,7 +210,7 @@
   if (error.Fail())
     return Error("Failed to create link to %s: %s",
                  module_file_path.GetPath().c_str(), error.AsCString());
-  return Error::success();
+  return Error();
 }
 
 Error ModuleCache::Get(const FileSpec &root_dir_spec, const char *hostname,
@@ -221,7 +221,7 @@
   if (find_it != m_loaded_modules.end()) {
     cached_module_sp = (*find_it).second.lock();
     if (cached_module_sp)
-      return Error::success();
+      return Error();
     m_loaded_modules.erase(find_it);
   }
 
@@ -263,7 +263,7 @@
   m_loaded_modules.insert(
       std::make_pair(module_spec.GetUUID().GetAsString(), cached_module_sp));
 
-  return Error::success();
+  return Error();
 }
 
 Error ModuleCache::GetAndPut(const FileSpec &root_dir_spec,
@@ -320,7 +320,7 @@
     // module might
     // contain the necessary symbols and the debugging is also possible without
     // a symfile.
-    return Error::success();
+    return Error();
 
   error = Put(root_dir_spec, escaped_hostname.c_str(), module_spec,
               tmp_download_sym_file_spec,
@@ -332,5 +332,5 @@
 
   FileSpec symfile_spec = GetSymbolFileSpec(cached_module_sp->GetFileSpec());
   cached_module_sp->SetSymbolFileFileSpec(symfile_spec);
-  return Error::success();
+  return Error();
 }