Skip to content

Commit 95c6c99

Browse files
committed
improve comments
1 parent 30b97aa commit 95c6c99

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

src/test/incremental/change_add_field/struct_point.rs

+25-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ mod point {
6969
}
7070
}
7171

72-
/// A fn item that calls (public) methods on `Point` from the same impl which changed
72+
/// A fn that has the changed type in its signature; must currently be
73+
/// rebuilt.
74+
///
75+
/// You could imagine that, in the future, if the change were
76+
/// sufficiently "private", we might not need to type-check again.
77+
/// Rebuilding is probably always necessary since the layout may be
78+
/// affected.
7379
mod fn_with_type_in_sig {
7480
use point::Point;
7581

@@ -79,6 +85,13 @@ mod fn_with_type_in_sig {
7985
}
8086
}
8187

88+
/// Call a fn that has the changed type in its signature; this
89+
/// currently must also be rebuilt.
90+
///
91+
/// You could imagine that, in the future, if the change were
92+
/// sufficiently "private", we might not need to type-check again.
93+
/// Rebuilding is probably always necessary since the layout may be
94+
/// affected.
8295
mod call_fn_with_type_in_sig {
8396
use fn_with_type_in_sig;
8497

@@ -88,7 +101,13 @@ mod call_fn_with_type_in_sig {
88101
}
89102
}
90103

91-
/// A fn item that calls (public) methods on `Point` from the same impl which changed
104+
/// A fn that uses the changed type, but only in its body, not its
105+
/// signature.
106+
///
107+
/// You could imagine that, in the future, if the change were
108+
/// sufficiently "private", we might not need to type-check again.
109+
/// Rebuilding is probably always necessary since the layout may be
110+
/// affected.
92111
mod fn_with_type_in_body {
93112
use point::Point;
94113

@@ -98,7 +117,10 @@ mod fn_with_type_in_body {
98117
}
99118
}
100119

101-
/// A fn item that calls (public) methods on `Point` from the same impl which changed
120+
/// A fn X that calls a fn Y, where Y uses the changed type in its
121+
/// body. In this case, the effects of the change should be contained
122+
/// to Y; X should not have to be rebuilt, nor should it need to be
123+
/// typechecked again.
102124
mod call_fn_with_type_in_body {
103125
use fn_with_type_in_body;
104126

src/test/incremental/change_pub_inherent_method_body/struct_point.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test where we change the body of a private method in an impl.
12-
// We then test what sort of functions must be rebuilt as a result.
11+
// Test where we change the body of a public, inherent method.
1312

1413
// revisions:rpass1 rpass2
1514
// compile-flags: -Z query-dep-graph
@@ -49,7 +48,7 @@ mod point {
4948
}
5049
}
5150

52-
/// A fn item that calls (public) methods on `Point` from the same impl which changed
51+
/// A fn item that calls the method on `Point` which changed
5352
mod fn_calls_changed_method {
5453
use point::Point;
5554

@@ -61,7 +60,7 @@ mod fn_calls_changed_method {
6160
}
6261
}
6362

64-
/// A fn item that calls (public) methods on `Point` from the same impl which changed
63+
/// A fn item that calls a method on `Point` which did not change
6564
mod fn_calls_another_method {
6665
use point::Point;
6766

src/test/incremental/change_pub_inherent_method_sig/struct_point.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test where we change the body of a private method in an impl.
12-
// We then test what sort of functions must be rebuilt as a result.
11+
// Test where we change the *signature* of a public, inherent method.
1312

1413
// revisions:rpass1 rpass2
1514
// compile-flags: -Z query-dep-graph
@@ -60,7 +59,7 @@ mod point {
6059
}
6160
}
6261

63-
/// A fn item that calls (public) methods on `Point` from the same impl which changed
62+
/// A fn item that calls the method that was changed
6463
mod fn_calls_changed_method {
6564
use point::Point;
6665

@@ -71,7 +70,7 @@ mod fn_calls_changed_method {
7170
}
7271
}
7372

74-
/// A fn item that calls (public) methods on `Point` from the same impl which changed
73+
/// A fn item that calls a method that was not changed
7574
mod fn_calls_another_method {
7675
use point::Point;
7776

0 commit comments

Comments
 (0)