Re: [PATCH v1 25/28] rust: add `build_error` crate

Wei Liu
2022-11-14T21:06:26Z

On Mon, Nov 14, 2022 at 07:22:02PM +0100, Miguel Ojeda wrote:
> On Mon, Nov 14, 2022 at 3:30 PM Wei Liu <wei.liu@kernel.org> wrote:
> >
> > a const function `build_error`
> >
> > Without this I read it as a "normal non-const function".
>
> Sounds good to me, especially given the sentence that goes after that.
>
> (I think "function" does not imply one or the other in principle. To
> me, `const` ones are normal too, in the sense that they can be used as
> any other function.)
>
> > I can work out what the code does, but I also happen to know what Rust's
> > const means and its behaviour in non-const context. Other kernel
> > developers may not. Even so the description is a bit difficult for me to
> > parse.
> >
> > Maybe a few sentences about const and its behaviours can help?
>
> Not sure if we should explain language details in the documentation of
> particular functions. But I agree this case is a bit special.
>
> What about linking the Rust reference/book/... (so that those terms
> are clickable when rendered)?

I think this works too.

>
> Thanks a lot for the reviews, Wei!
>

You're welcome.

Thanks,
Wei.

> Cheers,
> Miguel