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[E0658]: match is not allowed in a const fn #220

Closed
shangsony opened this issue Apr 21, 2021 · 7 comments
Closed

error[E0658]: match is not allowed in a const fn #220

shangsony opened this issue Apr 21, 2021 · 7 comments

Comments

@shangsony
Copy link

error[E0658]: match is not allowed in a const fn
-->/socket2-0.4.0/src/lib.rs:156:9
|
156 | / match address {
157 | | SocketAddr::V4() => Domain::IPV4,
158 | | SocketAddr::V6(
) => Domain::IPV6,
159 | | }
| |_________^
|
= note: see issue #49146 rust-lang/rust#49146 for more information

Compiling time v0.1.43
error: aborting due to previous error

@Thomasdezeeuw
Copy link
Collaborator

Socket2 v0.4 requires rustc v1.46.

@tychota
Copy link

tychota commented May 23, 2021

Note: the readme speak about minimum supported version of rust.

image

For me that means that new version should works.

Except they doesn't:

image
image

can you consider making compatibility to new rust version a goal to v0.5 ?

@tychota
Copy link

tychota commented May 23, 2021

@Thomasdezeeuw can you reopen ?

@Thomasdezeeuw
Copy link
Collaborator

@tychota I think you're doing something wrong. socket2 rust on rustc 1.46 stable. Are you sure you're calling the same rustc?

P.S. could you also not use images of texts, it's very annoying to read.

@tychota
Copy link

tychota commented May 23, 2021

@Thomasdezeeuw i will try to make a minimal example that reproduce and then report here.

My bad for the image, i will paste texte next time.

@Thomasdezeeuw
Copy link
Collaborator

@tychota you're really running a different/incorrect rustc binary. Per the 1.46 blogpost: https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html#const-fn-improvements, match statements are const, which the error is about.

@tychota
Copy link

tychota commented May 23, 2021

All clear. I indeed has an old rust binary somewhere.

Sorry for the noise.

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

3 participants