mirror of
				https://github.com/pytorch/pytorch.git
				synced 2025-10-27 17:54:55 +08:00 
			
		
		
		
	[jit] de-optionalize SourceRange context (#32880)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/32880 The PR below made it impossible to construct a SourceRange without a context, so get rid of its optional-ness Test Plan: Imported from OSS Differential Revision: D19670923 Pulled By: suo fbshipit-source-id: 05936fca2a3d5e613313ade9287b2210bc4a3ccd
This commit is contained in:
		
				
					committed by
					
						 Facebook Github Bot
						Facebook Github Bot
					
				
			
			
				
	
			
			
			
						parent
						
							d85c913bfd
						
					
				
				
					commit
					d13c1b8af8
				
			| @ -50,12 +50,8 @@ ErrorReport::CallStack::~CallStack() { | ||||
| const char* ErrorReport::what() const noexcept { | ||||
|   std::stringstream msg; | ||||
|   msg << "\n" << ss.str(); | ||||
|   if (context) { | ||||
|     msg << ":\n"; | ||||
|     context->highlight(msg); | ||||
|   } else { | ||||
|     msg << ".\n"; | ||||
|   } | ||||
|   msg << ":\n"; | ||||
|   context.highlight(msg); | ||||
|  | ||||
|   if (error_stack.size() > 0) { | ||||
|     for (auto it = error_stack.rbegin(); it != error_stack.rend() - 1; ++it) { | ||||
|  | ||||
| @ -38,7 +38,7 @@ struct CAFFE2_API ErrorReport : public std::exception { | ||||
|   friend const ErrorReport& operator<<(const ErrorReport& e, const T& t); | ||||
|  | ||||
|   mutable std::stringstream ss; | ||||
|   c10::optional<SourceRange> context; | ||||
|   SourceRange context; | ||||
|   mutable std::string the_message; | ||||
|   std::vector<Call> error_stack; | ||||
| }; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user