code: func (m *Module) PluginRequirements() discovery.PluginRequirements {
  	ret := make(discovery.PluginRequirements)
  	for inst, dep := range m.Providers {
  		// m.Providers is keyed on provider names, such as "aws.foo".
  		// a PluginRequirements wants keys to be provider *types*, such
  		// as "aws". If there are multiple aliases for the same
  		// provider then we will flatten them into a single requirement
  		// by combining their constraint sets.
  		pty := inst.Type()
  		if existing, exists := ret[pty]; exists {
  			ret[pty].Versions = existing.Versions.Append(dep.Constraints)
  		} else {
  			ret[pty] = &discovery.PluginConstraints{
  				Versions: dep.Constraints,
  			}
  		}
  	}
  	return ret
  }
docs: // PluginRequirements produces a PluginRequirements structure that can
  // be used with discovery.PluginMetaSet.ConstrainVersions to identify
  // suitable plugins to satisfy the module's provider dependencies.
  //
  // This method only considers the direct requirements of the receiver.
  // Use AllPluginRequirements to flatten the dependencies for the
  // entire tree of modules.
  //
  // Requirements returned by this method include only version constraints,
  // and apply no particular SHA256 hash constraint.