@@ -137,6 +137,8 @@ pub struct Range<'a, T: 'a> {
137
137
/// See its documentation for more.
138
138
///
139
139
/// [`difference`]: BTreeSet::difference
140
+ #[ must_use = "this returns the difference as an iterator, \
141
+ without modifying either input set"]
140
142
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
141
143
pub struct Difference < ' a , T : ' a > {
142
144
inner : DifferenceInner < ' a , T > ,
@@ -169,6 +171,8 @@ impl<T: fmt::Debug> fmt::Debug for Difference<'_, T> {
169
171
/// [`BTreeSet`]. See its documentation for more.
170
172
///
171
173
/// [`symmetric_difference`]: BTreeSet::symmetric_difference
174
+ #[ must_use = "this returns the difference as an iterator, \
175
+ without modifying either input set"]
172
176
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
173
177
pub struct SymmetricDifference < ' a , T : ' a > ( MergeIterInner < Iter < ' a , T > > ) ;
174
178
@@ -185,6 +189,8 @@ impl<T: fmt::Debug> fmt::Debug for SymmetricDifference<'_, T> {
185
189
/// See its documentation for more.
186
190
///
187
191
/// [`intersection`]: BTreeSet::intersection
192
+ #[ must_use = "this returns the intersection as an iterator, \
193
+ without modifying either input set"]
188
194
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
189
195
pub struct Intersection < ' a , T : ' a > {
190
196
inner : IntersectionInner < ' a , T > ,
@@ -217,6 +223,8 @@ impl<T: fmt::Debug> fmt::Debug for Intersection<'_, T> {
217
223
/// See its documentation for more.
218
224
///
219
225
/// [`union`]: BTreeSet::union
226
+ #[ must_use = "this returns the union as an iterator, \
227
+ without modifying either input set"]
220
228
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
221
229
pub struct Union < ' a , T : ' a > ( MergeIterInner < Iter < ' a , T > > ) ;
222
230
0 commit comments