Skip to content

Better error for normalization errors from parent crates that use #![feature(generic_const_exprs)] #94440

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

compiler-errors
Copy link
Member

This PR implements a somewhat rudimentary heuristic to suggest using #![feature(generic_const_exprs)] in a child crate when a function from a foreign crate (that may have used #![feature(generic_const_exprs)]) fails to normalize during codegen.

cc: #79018
cc: #94287

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 28, 2022
@rust-highfive
Copy link
Contributor

r? @wesleywiser

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 28, 2022
@compiler-errors
Copy link
Member Author

r? @lcnr
or perhaps you may know someone from project-const-generics who would like to review this? :^)

@rust-highfive rust-highfive assigned lcnr and unassigned wesleywiser Feb 28, 2022
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i somewhat dislike generic_const_exprs infecting layout computation. maybe instead add an else branch for

if infcx.tcx.features().generic_const_exprs {

where we fatal error if uv is from an extern crate and has an AbstractConst? Would prefer something like this here.

@compiler-errors
Copy link
Member Author

@lcnr I considered adding it there instead.. I'll try that!

@compiler-errors
Copy link
Member Author

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 28, 2022
@compiler-errors
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 4, 2022
@lcnr lcnr added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 8, 2022
@compiler-errors
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 9, 2022
@lcnr
Copy link
Contributor

lcnr commented Mar 10, 2022

@bors r+ rollup

thanks 👍

@bors
Copy link
Collaborator

bors commented Mar 10, 2022

📌 Commit 109cdc7 has been approved by lcnr

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 10, 2022
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Mar 10, 2022
Better error for normalization errors from parent crates that use `#![feature(generic_const_exprs)]`

This PR implements a somewhat rudimentary heuristic to suggest using `#![feature(generic_const_exprs)]` in a child crate when a function from a foreign crate (that may have used `#![feature(generic_const_exprs)]`) fails to normalize during codegen.

cc: rust-lang#79018
cc: rust-lang#94287
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 10, 2022
Better error for normalization errors from parent crates that use `#![feature(generic_const_exprs)]`

This PR implements a somewhat rudimentary heuristic to suggest using `#![feature(generic_const_exprs)]` in a child crate when a function from a foreign crate (that may have used `#![feature(generic_const_exprs)]`) fails to normalize during codegen.

cc: rust-lang#79018
cc: rust-lang#94287
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2022
…askrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#94440 (Better error for normalization errors from parent crates that use `#![feature(generic_const_exprs)]`)
 - rust-lang#94587 (Document new recommended use of `FromIterator::from_iter`)
 - rust-lang#94644 (Fix soundness issue in scoped threads.)
 - rust-lang#94740 (Unify impl blocks by wrapping them into a div)
 - rust-lang#94753 (Improve rustdoc book)
 - rust-lang#94796 (Allow `cargo run` instead of `cargo run -p bootstrap`)
 - rust-lang#94805 (Revert accidental stabilization)
 - rust-lang#94809 (RustWrapper: add missing include)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b413745 into rust-lang:master Mar 10, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 10, 2022
@compiler-errors compiler-errors deleted the issue-94282 branch April 7, 2022 04:33
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants