Skip to content

Fix const_fn ICE with non-const function pointer - #56337

Merged
bors merged 2 commits into
rust-lang:masterfrom
phansch:fix_const_ice
Nov 30, 2018
Merged

Fix const_fn ICE with non-const function pointer#56337
bors merged 2 commits into
rust-lang:masterfrom
phansch:fix_const_ice

Conversation

@phansch

@phanschphansch commented Nov 29, 2018

Copy link
Copy Markdown
Contributor

Fixes#56164

@phansch

Copy link
Copy Markdown
ContributorAuthor

r? @oli-obk

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what happened to the indent here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

vim messing up some indentation apparently ◀️ 🙁
I will add a separate commit to fix it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be strictly less ICEy if we just called not_const here and early returned

@phansch

Copy link
Copy Markdown
ContributorAuthor

I had to rebase from master which was rather complicated, so I opted to re-do this because that was quicker. I added an additional test for const fn foo() { (||{})() } and it's now using self.not_const() instead of a custom message.

@oli-obk

Copy link
Copy Markdown
Contributor

@bors r+

thanks

@bors

bors commented Nov 30, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 247ab49 has been approved by oli-obk

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 30, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Nov 30, 2018
@kennytmkennytm mentioned this pull request Nov 30, 2018
bors added a commit that referenced this pull request Nov 30, 2018
Rollup of 19 pull requests
Successful merges:
- #55011 (Add libstd Cargo feature "panic_immediate_abort")
- #55821 (Use sort_by_cached_key when the key function is not trivial/free)
- #56014 (add test for issue #21335)
- #56131 (Assorted tweaks)
- #56214 (Implement chalk unification routines)
- #56216 (Add TryFrom<&[T]> for [T; $N] where T: Copy)
- #56268 (Reuse the `P` in `InvocationCollector::fold_{,opt_}expr`.)
- #56324 (Use raw_entry for more efficient interning)
- #56336 (Clean up and streamline the pretty-printer)
- #56337 (Fix const_fn ICE with non-const function pointer)
- #56339 (Remove not used option)
- #56341 (Rename conversion util; remove duplicate util in librustc_codegen_llvm.)
- #56349 (rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker)
- #56355 (Add inline attributes and add unit to CommonTypes)
- #56360 (Optimize local linkchecker program)
- #56364 (Fix panic with outlives in existential type)
- #56365 (Stabilize self_struct_ctor feature.)
- #56367 (Moved some feature gate tests to correct location)
- #56373 (Update books)
@bors
bors merged commit 247ab49 into rust-lang:masterNov 30, 2018
@phansch
phansch deleted the fix_const_ice branch December 1, 2018 08:03
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@phansch@oli-obk@bors