295: Make storage fields of #nameGroupStorage private r=nikomatsakis a=mheiber

This change resolves a fixme that referenced #120.

This change breaks no tests, and, if I understand
correctly, does not affect user-facing API.

Here is the difference for the `HelloWorldGroupStorage__` struct
generated from macros in the `hello_world` example:

**Before:**

```rs
struct HelloWorldGroupStorage__ {
    pub input_string:std::sync::Arc<<InputStringQuery as salsa::Query> ::Storage> ,pub length:std::sync::Arc<<LengthQuery as salsa::Query> ::Storage> ,
}
```

**After:**

```rs
struct HelloWorldGroupStorage__ {
    input_string:std::sync::Arc<<InputStringQuery as salsa::Query> ::Storage> ,length:std::sync::Arc<<LengthQuery as salsa::Query> ::Storage> ,
}
```

Co-authored-by: Maxwell Elliot Heiber <mheiber@fb.com>
This commit is contained in:
bors[bot] 2022-01-25 19:54:56 +00:00 committed by GitHub
commit 73aba192c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -310,10 +310,8 @@ pub(crate) fn query_group(args: TokenStream, input: TokenStream) -> TokenStream
}
// A field for the storage struct
//
// FIXME(#120): the pub should not be necessary once we complete the transition
storage_fields.extend(quote! {
pub #fn_name: std::sync::Arc<<#qt as salsa::Query>::Storage>,
#fn_name: std::sync::Arc<<#qt as salsa::Query>::Storage>,
});
}