-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
inferred repeat expression length unnecessarily needs Copy
#110443
Labels
C-bug
Category: This is a bug.
F-generic_arg_infer
Using `_` as a const argument: #![feature(generic_arg_infer)]`
Comments
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 14, 2025
…<try> Defer repeat expr `Copy` checks to end of type checking Fixes rust-lang#110443 r? `@ghost`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 28, 2025
…r=compiler-errors Defer repeat expr `Copy` checks to end of type checking Fixes rust-lang#110443 Defers repeat expr checks that the element type is `Copy` when the length is > 1 (or generic) to end of typeck so that under `generic_arg_infer` repeat exprs are able to have an inferred count, e.g. `let a: [_; 1] = [String::new(); _];`. Currently the deferring is gated under `generic_arg_infer` though I intend to separately types FCP deferring the checks even outside of `generic_arg_infer` if we wind up not going with an alternative.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 28, 2025
…r=compiler-errors Defer repeat expr `Copy` checks to end of type checking Fixes rust-lang#110443 Defers repeat expr checks that the element type is `Copy` when the length is > 1 (or generic) to end of typeck so that under `generic_arg_infer` repeat exprs are able to have an inferred count, e.g. `let a: [_; 1] = [String::new(); _];`. Currently the deferring is gated under `generic_arg_infer` though I intend to separately types FCP deferring the checks even outside of `generic_arg_infer` if we wind up not going with an alternative.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 1, 2025
Rollup merge of rust-lang#137045 - BoxyUwU:defer_repeat_expr_checks, r=compiler-errors Defer repeat expr `Copy` checks to end of type checking Fixes rust-lang#110443 Defers repeat expr checks that the element type is `Copy` when the length is > 1 (or generic) to end of typeck so that under `generic_arg_infer` repeat exprs are able to have an inferred count, e.g. `let a: [_; 1] = [String::new(); _];`. Currently the deferring is gated under `generic_arg_infer` though I intend to separately types FCP deferring the checks even outside of `generic_arg_infer` if we wind up not going with an alternative.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
F-generic_arg_infer
Using `_` as a const argument: #![feature(generic_arg_infer)]`
results in the following error:
we should be able to solve that by using marker traits (potentially waiting until they're stable)
and then change hir typeck to require
RepeatExprMayCopyValue
for the array instead of optionally requiringCopy
for the value.The text was updated successfully, but these errors were encountered: