Skip to content

Commit 2cc0ef6

Browse files
committed
[stdlib] Removed &/
We believe this operator is not useful. rdar://problem/17926954 Swift SVN r25159
1 parent a0ecab5 commit 2cc0ef6

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

stdlib/core/IntegerArithmetic.swift.gyb

+2
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ public func ${op} <T: _IntegerArithmeticType>(lhs: T, rhs: T) -> T {
5757
return _overflowChecked(T.${name}WithOverflow(lhs, rhs))
5858
}
5959

60+
% if op != '/':
6061
/// ${name} `lhs` and `rhs`, silently discarding any overflow.
6162
@transparent
6263
public func &${op} <T: _IntegerArithmeticType>(lhs: T, rhs: T) -> T {
6364
return T.${name}WithOverflow(lhs, rhs).0
6465
}
66+
% end
6567

6668
/// ${name} `lhs` and `rhs` and store the result in `lhs`, trapping in
6769
/// case of arithmetic overflow (except in -Ounchecked builds).

stdlib/core/ManagedBuffer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public struct ManagedBufferPointer<Value, Element> : Equatable {
238238
/// idea to store this information in the "value" area when
239239
/// an instance is created.
240240
public var allocatedElementCount: Int {
241-
return (_allocatedByteCount &- _My._elementOffset) &/ strideof(Element)
241+
return (_allocatedByteCount &- _My._elementOffset) / strideof(Element)
242242
}
243243

244244
/// Call `body` with an `UnsafeMutablePointer` to the stored

stdlib/core/Policy.swift

-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ infix operator >> { associativity none precedence 160 }
371371
infix operator * { associativity left precedence 150 }
372372
infix operator &* { associativity left precedence 150 }
373373
infix operator / { associativity left precedence 150 }
374-
infix operator &/ { associativity left precedence 150 }
375374
infix operator % { associativity left precedence 150 }
376375
infix operator &% { associativity left precedence 150 }
377376
infix operator & { associativity left precedence 150 }

utils/SwiftIntTypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def numeric_type_names_Macintosh_only():
8989
# Swift_Programming_Language/Expressions.html
9090

9191
def all_integer_binary_operator_names():
92-
return ['<<', '>>', '&*', '&/', '&%', '&', '&+', '&-', '|', '^']
92+
return ['<<', '>>', '&*', '&%', '&', '&+', '&-', '|', '^']
9393

9494
def all_integer_or_real_binary_operator_names():
9595
return ['*', '/', '%', '+', '-', '..<', '...']

0 commit comments

Comments
 (0)