Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error[E0015]: cannot call non-const fn Identity::new in constant functions #784

Closed
RemiBardon opened this issue Aug 13, 2024 · 5 comments
Closed

Comments

@RemiBardon
Copy link

I just added tower to my project, so I naturally chose version v0.5.0 (just-released). Unfortunately it doesn't build:

   Compiling tower v0.5.0
error[E0015]: cannot call non-const fn `Identity::new` in constant functions
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tower-0.5.0/src/builder/mod.rs:120:20
    |
120 |             layer: Identity::new(),
    |                    ^^^^^^^^^^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants

v0.4.13 builds successfully so I switched to it for the time being.

I'm running:

rustup 1.27.1 (54dd3d00f 2024-04-24)
rustc 1.82.0-nightly (91376f416 2024-08-12)
@seanmonstar
Copy link
Collaborator

I see that tower-layer also released a new version making that function const. So you'd need to make sure to cargo update both tower and tower-layer to get them.

Within tower, we could bump the minimal version to make sure it's always picked up...

@RemiBardon
Copy link
Author

Ok so I added the two dependencies at the worse timing then 😅 I added tower-http a few hours ago, before tower v0.5.0 was released

@RemiBardon
Copy link
Author

That was it, sorry for bothering

@agourlay
Copy link
Contributor

Ran into the same issue, decided to implement the proper fix in #787

praseodym added a commit to kiesraad/abacus that referenced this issue Aug 19, 2024
@praseodym
Copy link

praseodym commented Aug 19, 2024

We hit this issue too with a Dependabot upgrade from Tower 0.4.13 to 0.5.0. Maybe a 0.5.1 release with the fix from #787 could prevent more people from running into this?

adombeck added a commit to ubuntu/authd that referenced this issue Aug 21, 2024
WorldSEnder added a commit to yewstack/yew that referenced this issue Aug 22, 2024
WorldSEnder added a commit to yewstack/yew that referenced this issue Aug 22, 2024
* Bump the cargo-deps group across 1 directory with 23 updates

Bumps the cargo-deps group with 20 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.3.0` | `2.4.0` |
| [js-sys](https://github.com/rustwasm/wasm-bindgen) | `0.3.69` | `0.3.70` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.55` | `1.0.63` |
| [serde](https://github.com/serde-rs/serde) | `1.0.193` | `1.0.208` |
| [web-sys](https://github.com/rustwasm/wasm-bindgen) | `0.3.69` | `0.3.70` |
| [wasm-bindgen-futures](https://github.com/rustwasm/wasm-bindgen) | `0.4.42` | `0.4.43` |
| [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen) | `0.3.42` | `0.3.43` |
| [trybuild](https://github.com/dtolnay/trybuild) | `1.0.86` | `1.0.99` |
| [syn](https://github.com/dtolnay/syn) | `2.0.72` | `2.0.75` |
| [getrandom](https://github.com/rust-random/getrandom) | `0.2.14` | `0.2.15` |
| [tabled](https://github.com/zhiburt/tabled) | `0.15.0` | `0.16.0` |
| [clap](https://github.com/clap-rs/clap) | `4.5.13` | `4.5.16` |
| [reqwest](https://github.com/seanmonstar/reqwest) | `0.12.5` | `0.12.7` |
| [derive_more](https://github.com/JelteF/derive_more) | `0.99.18` | `1.0.0` |
| [gloo-net](https://github.com/rustwasm/gloo) | `0.5.0` | `0.6.0` |
| [pulldown-cmark](https://github.com/raphlinus/pulldown-cmark) | `0.9.6` | `0.12.0` |
| [hyper-util](https://github.com/hyperium/hyper-util) | `0.1.6` | `0.1.7` |
| [tower](https://github.com/tower-rs/tower) | `0.4.13` | `0.5.0` |
| [env_logger](https://github.com/rust-cli/env_logger) | `0.10.2` | `0.11.5` |
| [postcard](https://github.com/jamesmunns/postcard) | `1.0.8` | `1.0.10` |



Updates `indexmap` from 2.3.0 to 2.4.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](indexmap-rs/indexmap@2.3.0...2.4.0)

Updates `js-sys` from 0.3.69 to 0.3.70
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Updates `wasm-bindgen` from 0.2.92 to 0.2.93
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](rustwasm/wasm-bindgen@0.2.92...0.2.93)

Updates `thiserror` from 1.0.55 to 1.0.63
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@1.0.55...1.0.63)

Updates `serde` from 1.0.193 to 1.0.208
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.193...v1.0.208)

Updates `web-sys` from 0.3.69 to 0.3.70
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Updates `wasm-bindgen-futures` from 0.4.42 to 0.4.43
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Updates `wasm-bindgen-test` from 0.3.42 to 0.3.43
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Updates `trybuild` from 1.0.86 to 1.0.99
- [Release notes](https://github.com/dtolnay/trybuild/releases)
- [Commits](dtolnay/trybuild@1.0.86...1.0.99)

Updates `syn` from 2.0.72 to 2.0.75
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](dtolnay/syn@2.0.72...2.0.75)

Updates `getrandom` from 0.2.14 to 0.2.15
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](rust-random/getrandom@v0.2.14...v0.2.15)

Updates `tabled` from 0.15.0 to 0.16.0
- [Changelog](https://github.com/zhiburt/tabled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zhiburt/tabled/commits)

Updates `serde_json` from 1.0.109 to 1.0.125
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](serde-rs/json@v1.0.109...1.0.125)

Updates `clap` from 4.5.13 to 4.5.16
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@clap_complete-v4.5.13...clap_complete-v4.5.16)

Updates `reqwest` from 0.12.5 to 0.12.7
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](seanmonstar/reqwest@v0.12.5...v0.12.7)

Updates `derive_more` from 0.99.18 to 1.0.0
- [Release notes](https://github.com/JelteF/derive_more/releases)
- [Changelog](https://github.com/JelteF/derive_more/blob/master/CHANGELOG.md)
- [Commits](JelteF/derive_more@v0.99.18...v1.0.0)

Updates `gloo-net` from 0.5.0 to 0.6.0
- [Release notes](https://github.com/rustwasm/gloo/releases)
- [Changelog](https://github.com/rustwasm/gloo/blob/master/CHANGELOG.md)
- [Commits](rustwasm/gloo@0.5.0...0.6.0)

Updates `pulldown-cmark` from 0.9.6 to 0.12.0
- [Release notes](https://github.com/raphlinus/pulldown-cmark/releases)
- [Commits](pulldown-cmark/pulldown-cmark@v0.9.6...v0.12.0)

Updates `hyper-util` from 0.1.6 to 0.1.7
- [Release notes](https://github.com/hyperium/hyper-util/releases)
- [Changelog](https://github.com/hyperium/hyper-util/blob/master/CHANGELOG.md)
- [Commits](hyperium/hyper-util@v0.1.6...v0.1.7)

Updates `tower` from 0.4.13 to 0.5.0
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](tower-rs/tower@tower-0.4.13...tower-0.5.0)

Updates `env_logger` from 0.10.2 to 0.11.5
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](rust-cli/env_logger@v0.10.2...v0.11.5)

Updates `serde_derive` from 1.0.193 to 1.0.208
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.193...v1.0.208)

Updates `postcard` from 1.0.8 to 1.0.10
- [Release notes](https://github.com/jamesmunns/postcard/releases)
- [Changelog](https://github.com/jamesmunns/postcard/blob/main/CHANGELOG.md)
- [Commits](jamesmunns/postcard@v1.0.8...v1.0.10)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: js-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: wasm-bindgen
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: web-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: wasm-bindgen-futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: wasm-bindgen-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: trybuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: getrandom
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: tabled
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: derive_more
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: cargo-deps
- dependency-name: gloo-net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: pulldown-cmark
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: hyper-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: tower
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-deps
- dependency-name: serde_derive
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
- dependency-name: postcard
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-deps
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix markup parsing

* update web_sys bindings to non-deprecated

* fix formatting

* fix feature set for derive_more

* update lock file to work around tower-rs/tower#784

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Molzer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants