Skip to content

document constant expressions in rust.md reference manual #5551

Closed

Description

@pnkfelix

The section on "static items" (formerly entitled "constants") refers to some class of "constant expressions", but we have not defined what these are.

(I think catamorphism has noted this via comments in a few issues I have seen, but I have not seen an actual Issue for this topic; so I am promoting it to a full fledged issue.)

In particular, if we need a subgrammar, or some other sort of static analysis to classify the constant expressions correctly, then we should document it.

Activity

  1. pnkfelix commented on May 23, 2013

    @pnkfelix
    ContributorAuthor

    For example, should constant expressions include the production
    const-expr ::= (const-expr as type)
    as desired by issue #4063

  2. catamorphism commented on Jul 15, 2013

    @catamorphism
    Contributor

    Visiting for triage. Still important.

  3. pnkfelix commented on Oct 8, 2013

    @pnkfelix
    ContributorAuthor

    Another question, should constant expressions include the production
    const-expr ::= const-expr . id
    for field access on static constant struct values? (We currently explicitly fail to const-eval such expressions; but it seems like a potentially desirable feature; see e.g. #9762)

  4. brson commented on Apr 8, 2014

    @brson
    Contributor

    Nominating for removal from milestone.

  5. pnkfelix commented on Apr 9, 2014

    @pnkfelix
    ContributorAuthor

    @brson you think we can release 1.0 without a formal definition for the constant expression sublanguage?

  6. pnkfelix commented on Apr 10, 2014

    @pnkfelix
    ContributorAuthor

    Okay, we can live with shipping 1.0 without this, though it would be really good to have something nailed-down (and documented).

    Taking off the 1.0 milestone, but leaving as P-high to reflect its importance.

  7. removed this from the 1.0 milestone on Apr 10, 2014
  8. steveklabnik commented on Feb 13, 2015

    @steveklabnik
    Contributor

    We now do not refer to 'constant expressions' in the reference at all, and the section on statics seems fine to me. Giving this a close.

  9. nikomatsakis commented on Feb 27, 2015

    @nikomatsakis
    Contributor

    @steveklabnik I'm not sure I agree with this assessment. I guess it depends on what level of precision we are shooting for.

  10. steveklabnik commented on Feb 27, 2015

    @steveklabnik
    Contributor

    Okay, fill me in :)

  11. steveklabnik commented on Mar 4, 2016

    @steveklabnik
    Contributor

    Triage: have had several conversations about this, never quite been sure exactly what we want to put and where.

  12. added
    P-lowLow priority
    and removed on Oct 20, 2016
  13. added
    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
    on Mar 10, 2017
  14. steveklabnik commented on Mar 23, 2017

    @steveklabnik
    Contributor

    The reference is now in its own repo, so I have migrated this issue: rust-lang/reference#18

    Side note: wow, a four digit issue ID. An endangered species at this point...

  15. added a commit that references this issue on May 5, 2020
    76ddac5
  16. added a commit that references this issue on Aug 21, 2026
    cb78c40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsI-needs-decisionIssue: In need of a decision.P-lowLow prioritymetabugIssues about issues themselves ("bugs about bugs")

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions