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

Prevent type flags assertions being thrown in default_anon_const_substs if errors occurred #90396

Merged
merged 1 commit into from
Oct 30, 2021

Conversation

b-naber
Copy link
Contributor

@b-naber b-naber commented Oct 29, 2021

Fixes #90364
Fixes #88997

r? @lcnr

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 29, 2021
@rust-log-analyzer

This comment has been minimized.

@b-naber b-naber force-pushed the type_flags_ices_default_anon_consts branch from acdfb53 to 03253ab Compare October 29, 2021 11:40
@@ -293,7 +293,9 @@ pub(super) fn default_anon_const_substs(tcx: TyCtxt<'_>, def_id: DefId) -> Subst
for arg in substs.iter() {
let allowed_flags = ty::TypeFlags::MAY_NEED_DEFAULT_CONST_SUBSTS
| ty::TypeFlags::STILL_FURTHER_SPECIALIZABLE;
assert!(!arg.has_type_flags(!allowed_flags));
if !arg.has_type_flags(ty::TypeFlags::HAS_ERROR) {
Copy link
Contributor

Choose a reason for hiding this comment

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

i prefer adding HAS_ERROR to allowed_flags instead of checking the type flags twice.

after that r=me

@b-naber b-naber force-pushed the type_flags_ices_default_anon_consts branch from 03253ab to 8397ffa Compare October 29, 2021 11:43
@b-naber b-naber force-pushed the type_flags_ices_default_anon_consts branch from 8397ffa to 87fbf3c Compare October 29, 2021 11:48
@lcnr
Copy link
Contributor

lcnr commented Oct 29, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 29, 2021

📌 Commit 87fbf3c 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 Oct 29, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 30, 2021
…n_consts, r=lcnr

Prevent type flags assertions being thrown in default_anon_const_substs if errors occurred

Fixes rust-lang#90364
Fixes rust-lang#88997

r? `@lcnr`
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 30, 2021
…askrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#89876 (Make most std::ops traits const on numeric types)
 - rust-lang#90371 (Fix incorrect doc link)
 - rust-lang#90374 (Unify titles in rustdoc book doc attributes chapter)
 - rust-lang#90377 (Make `core::slice::from_raw_parts[_mut]` const)
 - rust-lang#90395 (Restrict liveness of mutable borrow of inner infcx in ConstInferUnifier::consts)
 - rust-lang#90396 (Prevent type flags assertions being thrown in default_anon_const_substs if errors occurred)
 - rust-lang#90402 (Add a few query descriptions)
 - rust-lang#90412 (Remove unnecessary `macro_use`s in rustdoc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d99dc7a into rust-lang:master Oct 30, 2021
@rustbot rustbot added this to the 1.58.0 milestone Oct 30, 2021
@b-naber b-naber deleted the type_flags_ices_default_anon_consts branch October 30, 2021 16:27
@lcnr lcnr added A-const-generics Area: const generics (parameters and arguments) F-generic_const_exprs `#![feature(generic_const_exprs)]` labels Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) F-generic_const_exprs `#![feature(generic_const_exprs)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
6 participants