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

typeck: adding type information to projection #18

Merged
merged 1 commit into from
Jul 7, 2020
Merged

Conversation

Azhng
Copy link

@Azhng Azhng commented Jun 25, 2020

This commit modifies the Place as follow:

  • remove 'ty' from ProjectionKind
  • added 'before_ty' and 'after_ty' to Projection
  • replace 'ty' in Place with 'base_ty'
  • introduce 'ty()' in Place to return the final type of the Place

Closes rust-lang/project-rfc-2229#5

@Azhng Azhng requested review from arora-aman and roxelo June 25, 2020 15:44
Copy link
Member

@roxelo roxelo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Author

@Azhng Azhng left a comment

Choose a reason for hiding this comment

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

Review addressed, PTAL @arora-aman

src/librustc_typeck/mem_categorization.rs Show resolved Hide resolved
src/librustc_typeck/mem_categorization.rs Outdated Show resolved Hide resolved
src/librustc_typeck/mem_categorization.rs Outdated Show resolved Hide resolved
@Azhng Azhng force-pushed the projection-ty branch 2 times, most recently from c4a334a to ee361a2 Compare June 25, 2020 19:11
Copy link
Member

@arora-aman arora-aman left a comment

Choose a reason for hiding this comment

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

LGTM, one nit.

src/librustc_typeck/mem_categorization.rs Outdated Show resolved Hide resolved
@sexxi-bot
Copy link
Collaborator

🏃‍♂️ Start running build job, job id: 473f5030-4845-4db6-8f74-1b278f9adb44

@sexxi-bot
Copy link
Collaborator

❌ Build job 473f5030-4845-4db6-8f74-1b278f9adb44 failed, access build log here: unit test failed: unit test failed: exit code: 1

@arora-aman
Copy link
Member

❌ Build job 473f5030-4845-4db6-8f74-1b278f9adb44 failed, access build log here: unit test failed: unit test failed: exit code: 1

I ran this myself and all tests passed, not sure what is going on. Also unit tests didn't fail or the build.

@Azhng
Copy link
Author

Azhng commented Jun 29, 2020

@arora-aman updated the PR with before_ty removed, can you PTAL

Copy link
Member

@arora-aman arora-aman left a comment

Choose a reason for hiding this comment

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

LGTM

@arora-aman
Copy link
Member

FYI: changes made because of discussions on rust-lang/project-rfc-2229#13

@arora-aman arora-aman requested review from sexxi-bot and removed request for sexxi-bot June 29, 2020 19:21
@sexxi-bot
Copy link
Collaborator

🏃‍♂️ Start running build job, job id: a79307f9-423b-42ae-ac70-712c94cde20e

@sexxi-bot
Copy link
Collaborator

❌ Build job a79307f9-423b-42ae-ac70-712c94cde20e failed, access build log here: unit test failed: unit test failed: exit code: 1

@Azhng
Copy link
Author

Azhng commented Jun 29, 2020

Opening PR to Rust repo at rust-lang#73870

@Azhng Azhng removed the request for review from sexxi-bot June 29, 2020 19:53
This commit modifies the Place as follow:
* remove 'ty' from ProjectionKind
* add type information into to Projection
* replace 'ty' in Place with 'base_ty'
* introduce 'ty()' in `Place` to return the final type of the `Place`
* introduce `ty_before_projection()` in `Place` to return the type of
  a `Place` before i'th projection is applied

Closes rust-lang/project-rfc-2229#5
@sexxi-bot sexxi-bot merged commit 7942d9a into master Jul 7, 2020
@arora-aman arora-aman deleted the projection-ty branch July 7, 2020 05:32
sexxi-bot pushed a commit that referenced this pull request Oct 5, 2020
This is a combination of 18 commits.

Commit #2:

Additional examples and some small improvements.

Commit #3:

fixed mir-opt non-mir extensions and spanview title elements

Corrected a fairly recent assumption in runtest.rs that all MIR dump
files end in .mir. (It was appending .mir to the graphviz .dot and
spanview .html file names when generating blessed output files. That
also left outdated files in the baseline alongside the files with the
incorrect names, which I've now removed.)

Updated spanview HTML title elements to match their content, replacing a
hardcoded and incorrect name that was left in accidentally when
originally submitted.

Commit #4:

added more test examples

also improved Makefiles with support for non-zero exit status and to
force validation of tests unless a specific test overrides it with a
specific comment.

Commit #5:

Fixed rare issues after testing on real-world crate

Commit #6:

Addressed PR feedback, and removed temporary -Zexperimental-coverage

-Zinstrument-coverage once again supports the latest capabilities of
LLVM instrprof coverage instrumentation.

Also fixed a bug in spanview.

Commit #7:

Fix closure handling, add tests for closures and inner items

And cleaned up other tests for consistency, and to make it more clear
where spans start/end by breaking up lines.

Commit #8:

renamed "typical" test results "expected"

Now that the `llvm-cov show` tests are improved to normally expect
matching actuals, and to allow individual tests to override that
expectation.

Commit #9:

test coverage of inline generic struct function

Commit #10:

Addressed review feedback

* Removed unnecessary Unreachable filter.
* Replaced a match wildcard with remining variants.
* Added more comments to help clarify the role of successors() in the
CFG traversal

Commit #11:

refactoring based on feedback

* refactored `fn coverage_spans()`.
* changed the way I expand an empty coverage span to improve performance
* fixed a typo that I had accidently left in, in visit.rs

Commit #12:

Optimized use of SourceMap and SourceFile

Commit rust-lang#13:

Fixed a regression, and synched with upstream

Some generated test file names changed due to some new change upstream.

Commit #14:

Stripping out crate disambiguators from demangled names

These can vary depending on the test platform.

Commit #15:

Ignore llvm-cov show diff on test with generics, expand IO error message

Tests with generics produce llvm-cov show results with demangled names
that can include an unstable "crate disambiguator" (hex value). The
value changes when run in the Rust CI Windows environment. I added a sed
filter to strip them out (in a prior commit), but sed also appears to
fail in the same environment. Until I can figure out a workaround, I'm
just going to ignore this specific test result. I added a FIXME to
follow up later, but it's not that critical.

I also saw an error with Windows GNU, but the IO error did not
specify a path for the directory or file that triggered the error. I
updated the error messages to provide more info for next, time but also
noticed some other tests with similar steps did not fail. Looks
spurious.

Commit #16:

Modify rust-demangler to strip disambiguators by default

Commit #17:

Remove std::process::exit from coverage tests

Due to Issue rust-lang#77553, programs that call std::process::exit() do not
generate coverage results on Windows MSVC.

Commit #18:

fix: test file paths exceeding Windows max path len
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store Type Information within projections
4 participants