Skip to content

Commit f23d90a

Browse files
committed
add FIXMEs pleading for post-@ edit of commentary on mem_categorization
(The present author fears not being knowledgeable enough to rewrite the comments unilaterally; merely calling it out is a lazy half-measure, but at least doesn't actively make things worse the way an ill-informed rewrite would.)
1 parent 735d1bd commit f23d90a

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/librustc/middle/mem_categorization.rs

+14-8
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,18 @@ pub enum Note {
179179
// and how it is located, as well as the mutability of the memory in
180180
// which the value is stored.
181181
//
182-
// *WARNING* The field `cmt.ty` is NOT necessarily the same as the
183-
// result of `node_id_to_type(cmt.id)`. This is because the `id` is
184-
// always the `id` of the node producing the type; in an expression
185-
// like `*x`, the type of this deref node is the deref'd type (`T`),
186-
// but in a pattern like `@x`, the `@x` pattern is again a
187-
// dereference, but its type is the type *before* the dereference
188-
// (`@T`). So use `cmt.ty` to find the type of the value in a consistent
189-
// fashion. For more details, see the method `cat_pattern`
182+
// *WARNING* The field `cmt.type` is NOT necessarily the same as the
183+
// result of `node_id_to_type(cmt.id)`.
184+
//
185+
// (FIXME: rewrite the following comment given that `@x` managed
186+
// pointers have been obsolete for quite some time.)
187+
//
188+
// This is because the `id` is always the `id` of the node producing the
189+
// type; in an expression like `*x`, the type of this deref node is the
190+
// deref'd type (`T`), but in a pattern like `@x`, the `@x` pattern is
191+
// again a dereference, but its type is the type *before* the
192+
// dereference (`@T`). So use `cmt.ty` to find the type of the value in
193+
// a consistent fashion. For more details, see the method `cat_pattern`
190194
#[derive(Clone, Debug, PartialEq)]
191195
pub struct cmt_<'tcx> {
192196
pub hir_id: hir::HirId, // HIR id of expr/pat producing this value
@@ -1192,6 +1196,8 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
11921196
// value, and I consider them to produce the value that was
11931197
// matched. So if you have something like:
11941198
//
1199+
// (FIXME: `@@3` is not legal code anymore!)
1200+
//
11951201
// let x = @@3;
11961202
// match x {
11971203
// @@y { ... }

0 commit comments

Comments
 (0)