@@ -60,7 +60,7 @@ class [[sus_trivial_abi]] Slice {
60
60
constexpr Slice () : Slice (nullptr , 0_usize) {}
61
61
62
62
static constexpr inline Slice from_raw_parts (::sus::marker::UnsafeFnMarker,
63
- T* data,
63
+ T* data sus_lifetimebound ,
64
64
::sus::usize len) noexcept {
65
65
::sus::check (size_t {len} <= size_t {isize::MAX_PRIMITIVE});
66
66
return Slice (data, len);
@@ -84,13 +84,12 @@ class [[sus_trivial_abi]] Slice {
84
84
// / # Panics
85
85
// / If the index `i` is beyond the end of the slice, the function will panic.
86
86
// / #[doc.overloads=slice.index.usize]
87
- constexpr inline const T& operator [](usize i) const & noexcept
88
- sus_lifetimebound {
87
+ constexpr inline const T& operator [](usize i) const & noexcept {
89
88
check (i < len_);
90
89
return data_[i.primitive_value ];
91
90
}
92
91
93
- constexpr T& operator [](usize i) & noexcept sus_lifetimebound
92
+ constexpr T& operator [](usize i) & noexcept
94
93
requires (!std::is_const_v<T>)
95
94
{
96
95
check (i < len_);
@@ -99,7 +98,7 @@ class [[sus_trivial_abi]] Slice {
99
98
100
99
// / Returns a const reference to the element at index `i`, or `None` if
101
100
// / `i` is beyond the end of the Slice.
102
- constexpr Option<const T&> get (usize i) const & noexcept sus_lifetimebound {
101
+ constexpr Option<const T&> get (usize i) const & noexcept {
103
102
if (i < len_) [[likely]]
104
103
return Option<const T&>::some (data_[i.primitive_value ]);
105
104
else
@@ -108,7 +107,7 @@ class [[sus_trivial_abi]] Slice {
108
107
109
108
// / Returns a mutable reference to the element at index `i`, or `None` if
110
109
// / `i` is beyond the end of the Slice.
111
- constexpr Option<T&> get_mut (usize i) & noexcept sus_lifetimebound
110
+ constexpr Option<T&> get_mut (usize i) & noexcept
112
111
requires (!std::is_const_v<T>)
113
112
{
114
113
if (i < len_) [[likely]]
@@ -124,8 +123,7 @@ class [[sus_trivial_abi]] Slice {
124
123
// / Behaviour results. The size of the slice must therefore also have a length
125
124
// / of at least 1.
126
125
constexpr inline const T& get_unchecked (::sus::marker::UnsafeFnMarker,
127
- usize i) const & noexcept
128
- sus_lifetimebound {
126
+ usize i) const & noexcept {
129
127
return data_[i.primitive_value ];
130
128
}
131
129
@@ -136,7 +134,7 @@ class [[sus_trivial_abi]] Slice {
136
134
// / Behaviour results. The size of the slice must therefore also have a length
137
135
// / of at least 1.
138
136
constexpr inline T& get_unchecked_mut (::sus::marker::UnsafeFnMarker,
139
- usize i) & noexcept sus_lifetimebound
137
+ usize i) & noexcept
140
138
requires (!std::is_const_v<T>)
141
139
{
142
140
return data_[i.primitive_value ];
@@ -155,8 +153,7 @@ class [[sus_trivial_abi]] Slice {
155
153
// / function will panic.
156
154
// / #[doc.overloads=slice.index.range]
157
155
constexpr inline Slice<T> operator [](
158
- const ::sus::ops::RangeBounds<usize> auto range) const noexcept
159
- sus_lifetimebound {
156
+ const ::sus::ops::RangeBounds<usize> auto range) const noexcept {
160
157
const usize start = range.start_bound ().unwrap_or (0u );
161
158
const usize end = range.end_bound ().unwrap_or (len_);
162
159
const usize len = end >= start ? end - start : 0u ;
@@ -177,8 +174,7 @@ class [[sus_trivial_abi]] Slice {
177
174
// / Returns None if the Range would otherwise contain an element that is out
178
175
// / of bounds.
179
176
constexpr Option<Slice<T>> get_range (
180
- const ::sus::ops::RangeBounds<usize> auto range) const noexcept
181
- sus_lifetimebound {
177
+ const ::sus::ops::RangeBounds<usize> auto range) const noexcept {
182
178
const usize start = range.start_bound ().unwrap_or (0u );
183
179
const usize end = range.end_bound ().unwrap_or (len_);
184
180
const usize len = end >= start ? end - start : 0u ;
@@ -201,8 +197,7 @@ class [[sus_trivial_abi]] Slice {
201
197
// / of bounds of the Slice, which can result in Undefined Behaviour.
202
198
constexpr Slice<T> get_range_unchecked (
203
199
::sus::marker::UnsafeFnMarker,
204
- const ::sus::ops::RangeBounds<usize> auto range) const noexcept
205
- sus_lifetimebound {
200
+ const ::sus::ops::RangeBounds<usize> auto range) const noexcept {
206
201
const usize start = range.start_bound ().unwrap_or (0u );
207
202
const usize end = range.end_bound ().unwrap_or (len_);
208
203
const usize len = end >= start ? end - start : 0u ;
@@ -287,13 +282,13 @@ class [[sus_trivial_abi]] Slice {
287
282
}
288
283
289
284
// / Returns a const pointer to the first element in the slice.
290
- inline const T* as_ptr () const & noexcept sus_lifetimebound {
285
+ inline const T* as_ptr () const & noexcept {
291
286
check (len_ > 0_usize);
292
287
return data_;
293
288
}
294
289
295
290
// / Returns a mutable pointer to the first element in the slice.
296
- inline T* as_mut_ptr () & noexcept sus_lifetimebound
291
+ inline T* as_mut_ptr () & noexcept
297
292
requires (!std::is_const_v<T>)
298
293
{
299
294
check (len_ > 0_usize);
@@ -303,14 +298,14 @@ class [[sus_trivial_abi]] Slice {
303
298
// / Returns an iterator over all the elements in the slice, visited in the
304
299
// / same order they appear in the slice. The iterator gives const access to
305
300
// / each element.
306
- constexpr SliceIter<const T&> iter () const & noexcept sus_lifetimebound {
301
+ constexpr SliceIter<const T&> iter () const & noexcept {
307
302
return SliceIter<const T&>::with (data_, len_);
308
303
}
309
304
310
305
// / Returns an iterator over all the elements in the slice, visited in the
311
306
// / same order they appear in the slice. The iterator gives mutable access to
312
307
// / each element.
313
- constexpr SliceIterMut<T&> iter_mut () noexcept sus_lifetimebound
308
+ constexpr SliceIterMut<T&> iter_mut () noexcept
314
309
requires (!std::is_const_v<T>)
315
310
{
316
311
return SliceIterMut<T&>::with (data_, len_);
0 commit comments