Skip to content

opt-level = s and opt-level = z don't seem to work #7240

@michaelwoerister

Description

@michaelwoerister

Problem

Specifying opt-level = s or opt-level = z for a profile fails with the following error:

$ cargo build
error: failed to parse manifest at `/xoxo/stuff/cargo-opt-level-size-bug/Cargo.toml`

Caused by:
  could not parse input as TOML

Caused by:
  invalid number at line 10

Steps

  1. Create a new project with cargo new repro
  2. Add
    [profile.dev]
    opt-level = s
    to Cargo.toml.
  3. Run cargo build

Possible Solution(s)

Fix the Cargo.toml parser?

Notes

Output of cargo version:

cargo 1.36.0 (c4fcfb725 2019-05-15)
cargo 1.38.0-nightly (26092da33 2019-07-31)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.A-tomlArea: TOML parsing and handlingC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions