Allow const parameters in array sizes to be unified#60742
Allow const parameters in array sizes to be unified#60742bors merged 17 commits intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
|
This changes some test output, but it's in very rare cases, and the messages are not incorrect (they're just a little extraneous). |
|
☔ The latest upstream changes (presumably #60765) made this pull request unmergeable. Please resolve the merge conflicts. |
7e94d17 to
6ced4f5
Compare
There was a problem hiding this comment.
cc @oli-obk should we wait until printing this is fixed?
src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs
Outdated
Show resolved
Hide resolved
|
I believe this is waiting on #59276, correct? |
|
@yodaldevoid: that is correct. |
|
I've added some tests to confirm this also fixes #60923. |
This comment has been minimized.
This comment has been minimized.
83c32f5 to
eee346f
Compare
|
I've added back in the special cased message for arrays of different lengths and fixed a typo in related diagnostics. This is ready for re-review @eddyb. |
There was a problem hiding this comment.
This... is really weird? I assume the 3 is @oli-obk's printing of same-crate anon consts?
There was a problem hiding this comment.
I think it's because it can't infer the specific type, rather than an issue with printing. This is a bug, though, which should be fixed by #60839. (Which is ready to go as soon as this one is.)
There was a problem hiding this comment.
I mean that the printing output is from Unevaluated for the 3 in Foo::<3> and not the value 3.
There was a problem hiding this comment.
ugh, ok I did not envision user facing effects from that. So.... should I just do _ or {{unevaluated}} or sth?
There was a problem hiding this comment.
I don't think we need to jump to something else here, but we should consider it carefully.
_ is clearly the conservative choice, as for "unevaluated" - I don't like that name too much, it just happened to be useful in ty::Const (and we could/should pick another name).
5211145 to
6233d1f
Compare
|
@bors r=eddyb |
|
📌 Commit 6233d1f has been approved by |
…eddyb Allow const parameters in array sizes to be unified Fixes rust-lang#60632. Fixes rust-lang#60744. Fixes rust-lang#60923. (The last commit should probably be viewed in isolation, as it just renames things from `type` to `kind`.) r? @eddyb
…eddyb Allow const parameters in array sizes to be unified Fixes rust-lang#60632. Fixes rust-lang#60744. Fixes rust-lang#60923. (The last commit should probably be viewed in isolation, as it just renames things from `type` to `kind`.) r? @eddyb
Rollup of 9 pull requests Successful merges: - #60742 (Allow const parameters in array sizes to be unified) - #60756 (Add better tests for hidden lifetimes in impl trait) - #60928 (Changes the type `mir::Mir` into `mir::Body`) - #61024 (tests: Centralize proc macros commonly used for testing) - #61157 (BufReader: In Seek impl, remove extra discard_buffer call) - #61195 (Special-case `.llvm` in mangler) - #61202 (Print PermissionExt::mode() in octal in Documentation Examples) - #61259 (Mailmap fixes) - #61273 (mention that MaybeUninit is a bit like Option) Failed merges: r? @ghost
Fixes #60632.
Fixes #60744.
Fixes #60923.
(The last commit should probably be viewed in isolation, as it just renames things from
typetokind.)r? @eddyb