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

Don't promote function calls to nonpromotable things #58784

Merged
merged 2 commits into from Mar 11, 2019

Conversation

Projects
None yet
7 participants
@oli-obk
Copy link
Contributor

oli-obk commented Feb 27, 2019

fixes #58767 and fixes #58634

r? @eddyb

should we additionally check the function call return type? It might be a promotable function (or any const fn inside a const fn), but its return type might contain interior mutability.

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Feb 28, 2019

discussed at T-compiler meeting. approved for beta backport.

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Mar 1, 2019

IsNotPromotable should be removed in favor of just IsNotConst, but right now this seems good.

Looks like the reason this regressed is because "not promotable" used to be turned into "not const" but at some point in the refactor I simplified it too much and only preserved "not const" from callee/arguments, but not "not promotable".

r=me with a FIXME about removing IsNotPromotable

@oli-obk

This comment has been minimized.

Copy link
Contributor Author

oli-obk commented Mar 1, 2019

@bors r=eddyb

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 1, 2019

📌 Commit 8c16507 has been approved by eddyb

bors added a commit that referenced this pull request Mar 4, 2019

Auto merge of #58784 - oli-obk:accidental_promotion, r=eddyb
Don't promote function calls to nonpromotable things

fixes #58767 and fixes #58634

r? @eddyb

should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 4, 2019

⌛️ Testing commit 8c16507 with merge f40e377...

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 4, 2019

💔 Test failed - status-appveyor

@ljedrz

This comment has been minimized.

Copy link
Contributor

ljedrz commented Mar 4, 2019

The error looks spurious; maybe my try rights are already in force?

@bors retry

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 4, 2019

⌛️ Testing commit 8c16507 with merge 113a74e...

bors added a commit that referenced this pull request Mar 4, 2019

Auto merge of #58784 - oli-obk:accidental_promotion, r=eddyb
Don't promote function calls to nonpromotable things

fixes #58767 and fixes #58634

r? @eddyb

should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 4, 2019

💔 Test failed - status-appveyor

@oli-obk

This comment has been minimized.

Copy link
Contributor Author

oli-obk commented Mar 5, 2019

Build completed successfully in 2:58:53
Command exited with code 259

@bors retry (different builder failed that passed in the previous run)

@oli-obk

This comment has been minimized.

Copy link
Contributor Author

oli-obk commented Mar 10, 2019

@bors r=eddyb p=1

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 10, 2019

💡 This pull request was already approved, no need to approve it again.

  • There's another pull request that is currently being tested, blocking this pull request: #56732
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 10, 2019

📌 Commit 8c16507 has been approved by eddyb

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 10, 2019

⌛️ Testing commit 8c16507 with merge 2d04b00...

bors added a commit that referenced this pull request Mar 10, 2019

Auto merge of #58784 - oli-obk:accidental_promotion, r=eddyb
Don't promote function calls to nonpromotable things

fixes #58767 and fixes #58634

r? @eddyb

should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 10, 2019

💔 Test failed - checks-travis

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Mar 10, 2019

The job i686-gnu-nopt of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[02:57:51] travis_fold:start:test_stage2-rustdoc
travis_time:start:test_stage2-rustdoc
Testing rustdoc stage2 (i686-unknown-linux-gnu -> i686-unknown-linux-gnu)
[02:57:51]    Compiling rustdoc v0.0.0 (/checkout/src/librustdoc)
The job exceeded the maximum time limit for jobs, and has been terminated.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@oli-obk

This comment has been minimized.

Copy link
Contributor Author

oli-obk commented Mar 10, 2019

@bors retry timeout

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 11, 2019

⌛️ Testing commit 8c16507 with merge c2ddf5a...

bors added a commit that referenced this pull request Mar 11, 2019

Auto merge of #58784 - oli-obk:accidental_promotion, r=eddyb
Don't promote function calls to nonpromotable things

fixes #58767 and fixes #58634

r? @eddyb

should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 11, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: eddyb
Pushing c2ddf5a to master...

@bors bors added the merged-by-bors label Mar 11, 2019

@bors bors merged commit 8c16507 into rust-lang:master Mar 11, 2019

1 check passed

homu Test successful
Details

@oli-obk oli-obk deleted the oli-obk:accidental_promotion branch Mar 11, 2019

bors added a commit that referenced this pull request Mar 16, 2019

Auto merge of #59235 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* Include bounds from promoted constants in NLL #57202
* Warning period for detecting nested impl trait #58608
* Don't promote function calls to nonpromotable things #58784
* Make migrate mode work at item level granularity #58788
* Expand where negative supertrait specific error is shown #58861
* Expand where negative supertrait specific error is shown #58861

Rolled up:

* [BETA] Update cargo #59217

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.