Skip to content

Document comparison used with limits #820

Description

@davidtwco

rust-lang/rust#72540 makes sure that all comparisons against limits in the compiler are consistent, this should be documented in doc.rust-lang.org/reference/attributes/limits.html. rust-lang/rust#72540 should land before this is documented.

Activity

  1. Havvy commented on May 28, 2020

    @Havvy
    Contributor

    Specifically, how has the comparison changed? Which sentences are now wrong?

  2. davidtwco commented on May 28, 2020

    @davidtwco
    MemberAuthor

    Specifically, how has the comparison changed? Which sentences are now wrong?

    No sentences are now wrong, but sentences could be added which describe that any values within the compiler are considered within the limit if they are less than or equal to the limit (previously this was inconsistent, sometimes less than, sometimes less than or equal).

  3. Havvy commented on May 28, 2020

    @Havvy
    Contributor

    What about the code examples? Do they compile with the changed code?

  4. davidtwco commented on May 28, 2020

    @davidtwco
    MemberAuthor

    What about the code examples? Do they compile with the changed code?

    The first example still fails as expected (though I had to add semicolons after each of the macro expansions when running with rust-lang/rust#72540 locally - so that example will probably need updated at some point).

    The second example failed with a different error than on the reference, but still due to recursion limits:

    error[E0275]: overflow evaluating the requirement `fn(): std::marker::Freeze`
      |
      = help: consider adding a `#![recursion_limit="2"]` attribute to your crate (`foo2`)
      = note: required because it appears within the type `[closure@std::rt::lang_start::{{closure}}#0 0:fn()]`
    

    The third example still fails as expected.

  5. added
    E-EasyWe believe this would not be difficult to actually fix
    on Jun 6, 2020
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-attributesArea: AttributesE-EasyWe believe this would not be difficult to actually fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions