diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h --- a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h +++ b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h @@ -58,6 +58,10 @@ : SparseTensorType( RankedTensorType::get(stp.getShape(), stp.getElementType(), enc)) {} + // Copy-assignment would be implicitly deleted (because our fields + // are const), so we explicitly delete it for clarity. + SparseTensorType &operator=(const SparseTensorType &) = delete; + /// Constructs a new `SparseTensorType` with the same dimension-shape /// and element type, but with the encoding replaced by the given encoding. SparseTensorType withEncoding(SparseTensorEncodingAttr newEnc) const {