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

Normalize function type during validation #78969

Merged
merged 2 commits into from
Nov 15, 2020
Merged

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Nov 12, 2020

During inlining, the callee body is normalized and has types revealed,
but some of locals corresponding to the arguments might come from the
caller body which is not. As a result the caller body does not pass
validation without additional normalization.

Closes #78442.

@rust-highfive
Copy link
Collaborator

r? @davidtwco

(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 Nov 12, 2020
@@ -357,7 +357,9 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
}
}
TerminatorKind::Call { func, args, destination, cleanup, .. } => {
let param_env = self.param_env.with_reveal_all_normalized(self.tcx);
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't self.param_env just be reveal all from the start here?

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

Implementation LGTM; can you add a test for #78442?

During inlining, the callee body is normalized and has types revealed,
but some of locals corresponding to the arguments might come from the
caller body which is not. As a result the caller body does not pass
validation without additional normalization.
@tmiasko
Copy link
Contributor Author

tmiasko commented Nov 12, 2020

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 13, 2020

📌 Commit 99be78d has been approved by davidtwco

@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 Nov 13, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 13, 2020
Normalize function type during validation

During inlining, the callee body is normalized and has types revealed,
but some of locals corresponding to the arguments might come from the
caller body which is not. As a result the caller body does not pass
validation without additional normalization.

Closes rust-lang#78442.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 13, 2020
Normalize function type during validation

During inlining, the callee body is normalized and has types revealed,
but some of locals corresponding to the arguments might come from the
caller body which is not. As a result the caller body does not pass
validation without additional normalization.

Closes rust-lang#78442.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 14, 2020
Normalize function type during validation

During inlining, the callee body is normalized and has types revealed,
but some of locals corresponding to the arguments might come from the
caller body which is not. As a result the caller body does not pass
validation without additional normalization.

Closes rust-lang#78442.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 15, 2020
Rollup of 15 pull requests

Successful merges:

 - rust-lang#78352 (Do not call `unwrap` with `signatures` option enabled)
 - rust-lang#78590 (refactor: removing alloc::collections::vec_deque ignore-tidy-filelength)
 - rust-lang#78848 (Bump minimal supported LLVM version to 9)
 - rust-lang#78856 (Explicitly checking for or-pattern before test)
 - rust-lang#78948 (test: add `()=()=()=...` to weird-exprs.rs)
 - rust-lang#78962 (Add a test for r# identifiers)
 - rust-lang#78963 (Added some unit tests as requested)
 - rust-lang#78966 (Never inline C variadics, cold functions, functions with incompatible attributes ...)
 - rust-lang#78968 (Include llvm-as in llvm-tools-preview component)
 - rust-lang#78969 (Normalize function type during validation)
 - rust-lang#78980 (Fix rustc_ast_pretty print_qpath resulting in invalid macro input)
 - rust-lang#78986 (Avoid installing external LLVM dylibs)
 - rust-lang#78988 (Fix an intrinsic invocation on threaded wasm)
 - rust-lang#78993 (rustc_target: Fix dash vs underscore mismatches in option names)
 - rust-lang#79013 (Clean up outdated `use_once_payload` pretty printer comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7e0441d into rust-lang:master Nov 15, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 15, 2020
@tmiasko tmiasko deleted the normalize branch November 15, 2020 10:21
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 19, 2020
…avidtwco

Revert rust-lang#78969 "Normalize function type during validation"

Closes rust-lang#79066.
Reopens rust-lang#78442.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 19, 2020
…avidtwco

Revert rust-lang#78969 "Normalize function type during validation"

Closes rust-lang#79066.
Reopens rust-lang#78442.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 19, 2020
…avidtwco

Revert rust-lang#78969 "Normalize function type during validation"

Closes rust-lang#79066.
Reopens rust-lang#78442.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 20, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#79119 (Clarify availability of atomic operations)
 - rust-lang#79123 (Add u128 and i128 integer tests)
 - rust-lang#79177 (Test drop order for (destructuring) assignments)
 - rust-lang#79181 (rustdoc: add [src] links to methods on a trait's page)
 - rust-lang#79183 (Make compiletest testing use the local sysroot)
 - rust-lang#79185 (expand/resolve: Pre-requisites to "Turn `#[derive]` into a regular macro attribute")
 - rust-lang#79193 (Revert rust-lang#78969 "Normalize function type during validation")
 - rust-lang#79194 (Make as{_mut,}_slice on array::IntoIter public)
 - rust-lang#79204 (Add jyn514 email alias to mailmap)
 - rust-lang#79212 (Move `rustc_ty` -> `rustc_ty_utils`)
 - rust-lang#79217 (Add the "memcpy" doc alias to slice::copy_from_slice)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: 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.

ICE: broken mir with -Zinline-mir issue-50865-private-impl-trait/auxiliary/lib.rs
6 participants