Skip to content

Commit

Permalink
Merge pull request #314 from thepowersgang/borrowcheck
Browse files Browse the repository at this point in the history
Lifetime Annotations and Inference
  • Loading branch information
thepowersgang authored Sep 3, 2023
2 parents b6754f5 + ac1d407 commit 5af6405
Show file tree
Hide file tree
Showing 109 changed files with 9,900 additions and 1,702 deletions.
1 change: 0 additions & 1 deletion .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: C/C++ CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: MSBuild

on:
push:
pull_request:
branches: [ "master" ]

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: vsproject/mrustc.sln

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

permissions:
contents: read

jobs:
build:
# Windows 2019 has VC140, -latest (-2022) does not
runs-on: windows-2019

steps:
# https://github.com/actions/runner-images/issues/842#issuecomment-643382166
# - Win8.1 SDK is (currently) used by mrustc
- name: Install Windows 8.1 SDK
shell: powershell
run: |
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=323507 -OutFile sdksetup.exe -UseBasicParsing
Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/features", "OptionId.WindowsDesktopSoftwareDevelopmentKit", "OptionId.NetFxSoftwareDevelopmentKit"
- uses: actions/checkout@v3

- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

- name: Save Artifacts
uses: actions/upload-artifact@v2
with:
name: binaries
# Includes `minipatch` as that's needed by the test scripts
# Needs `zlib[1].dll` for mrustc to run
path: |
vsproject/x64/${{env.BUILD_CONFIGURATION}}/minicargo.exe
vsproject/x64/${{env.BUILD_CONFIGURATION}}/mrustc.exe
vsproject/x64/${{env.BUILD_CONFIGURATION}}/testrunner.exe
vsproject/x64/${{env.BUILD_CONFIGURATION}}/minipatch.exe
vsproject/x64/${{env.BUILD_CONFIGURATION}}/mir_opt_test.exe
vsproject/x64/${{env.BUILD_CONFIGURATION}}/zlib.dll
vsproject/x64/${{env.BUILD_CONFIGURATION}}/zlib1.dll
test-run:
needs: build
strategy:
fail-fast: false
matrix:
#rustver: ["1.29", "1.39", "1.19", "1.54"]
# Note: Only run 1.54, to save on time
rustver: ["1.54"]
runs-on: windows-2019 # need compiler for C codegen, might as well use the same
env:
RUSTC_VERSION: ${{ matrix.rustver }}.0
MRUSTC_TARGET_VER: ${{ matrix.rustver }}
OUTDIR_SUF: -${{ matrix.rustver }}.0
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
with:
name: binaries
path: vsproject/x64/${{env.BUILD_CONFIGURATION}}
- uses: TheMrMilchmann/setup-msvc-dev@v2
with:
arch: x64
- name: Download rust source
shell: powershell
run: |
Invoke-WebRequest -Method Get -Uri https://static.rust-lang.org/dist/rustc-${{matrix.rustver}}.0-src.tar.gz -OutFile rustc-${{matrix.rustver}}.0-src.tar.gz -UseBasicParsing
# Chain 7z invocations to extract the tarball directly - see https://superuser.com/a/546694
- name: Extract rust source
shell: cmd
run: |
"c:\Program Files\7-Zip\7z.exe" x rustc-1.54.0-src.tar.gz -so | "c:\Program Files\7-Zip\7z.exe" x -aoa -si -ttar
- name: Build
run: |
cd vsproject
.\run_hello_Pick.cmd ${{ matrix.rustver }}
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ OBJ += ast/dump.o
OBJ += parse/parseerror.o
OBJ += parse/token.o parse/tokentree.o parse/interpolated_fragment.o
OBJ += parse/tokenstream.o parse/lex.o parse/ttstream.o
OBJ += parse/root.o parse/paths.o parse/types.o parse/expr.o parse/pattern.o
OBJ += parse/root.o parse/paths.o parse/types.o parse/expr.o parse/pattern.o
OBJ += expand/mod.o expand/macro_rules.o expand/cfg.o
OBJ += expand/format_args.o expand/asm.o
OBJ += expand/concat.o expand/stringify.o expand/file_line.o
Expand All @@ -105,25 +105,28 @@ OBJ += hir/type.o hir/path.o hir/expr.o hir/pattern.o
OBJ += hir/visitor.o hir/crate_post_load.o
OBJ += hir/inherent_cache.o
OBJ += hir_conv/expand_type.o hir_conv/constant_evaluation.o hir_conv/resolve_ufcs.o hir_conv/bind.o hir_conv/markings.o
OBJ += hir_conv/lifetime_elision.o
OBJ += hir_typeck/outer.o hir_typeck/common.o hir_typeck/helpers.o hir_typeck/static.o hir_typeck/impl_ref.o
OBJ += hir_typeck/resolve_common.o
OBJ += hir_typeck/expr_visit.o
OBJ += hir_typeck/expr_cs.o hir_typeck/expr_cs__enum.o
OBJ += hir_typeck/expr_check.o
OBJ += hir_typeck/resolve_common.o
OBJ += hir_typeck/expr_visit.o
OBJ += hir_typeck/expr_cs.o hir_typeck/expr_cs__enum.o
OBJ += hir_typeck/expr_check.o
OBJ += hir_expand/annotate_value_usage.o hir_expand/closures.o
OBJ += hir_expand/ufcs_everything.o
OBJ += hir_expand/reborrow.o hir_expand/erased_types.o hir_expand/vtable.o
OBJ += hir_expand/static_borrow_constants.o
OBJ += hir_expand/ufcs_everything.o
OBJ += hir_expand/reborrow.o hir_expand/erased_types.o hir_expand/vtable.o
OBJ += hir_expand/static_borrow_constants.o
OBJ += hir_expand/lifetime_infer.o
OBJ += mir/mir.o mir/mir_ptr.o
OBJ += mir/dump.o mir/helpers.o mir/visit_crate_mir.o
OBJ += mir/from_hir.o mir/from_hir_match.o mir/mir_builder.o
OBJ += mir/check.o mir/cleanup.o mir/optimise.o
OBJ += mir/check_full.o
OBJ += mir/borrow_check.o
OBJ += hir/serialise.o hir/deserialise.o hir/serialise_lowlevel.o
OBJ += trans/trans_list.o trans/mangling_v2.o
OBJ += trans/enumerate.o trans/auto_impls.o trans/monomorphise.o trans/codegen.o
OBJ += trans/codegen_c.o trans/codegen_c_structured.o trans/codegen_mmir.o
OBJ += trans/target.o trans/allocator.o
OBJ += trans/enumerate.o trans/auto_impls.o trans/monomorphise.o trans/codegen.o
OBJ += trans/codegen_c.o trans/codegen_c_structured.o trans/codegen_mmir.o
OBJ += trans/target.o trans/allocator.o

# TODO is this needed? (or worth it)
PCHS := ast/ast.hpp
Expand Down
Loading

0 comments on commit 5af6405

Please sign in to comment.