aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-04-18CI: do not push Docker image ...liushuyu1-1/+2
... when the workflow is ran in a forked repository Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
2022-04-16Merge #1122bors[bot]1-1/+1
1122: testsuite/rust: fix test case failure on macOS r=CohenArthur a=liushuyu - extent `macro_return` xfail targets to three-segment triples Co-authored-by: liushuyu <liushuyu011@gmail.com>
2022-04-16Merge #1118bors[bot]3-6/+92
1118: Add reachability visitor to Enum variants r=CohenArthur a=CohenArthur This visits all of an enum's variants and their fields if present. To do that properly, this adds a new `EnumItemKind` enum which allows static casting when visiting each variant of the enum (kept as an `EnumItem` class which is derived three times) Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
2022-04-15testsuite/rust: extent xfail targetsliushuyu1-1/+1
2022-04-15Merge #1107bors[bot]2-0/+14
1107: tests: Improve timeout handling r=philberty a=liushuyu - add a 10-second timeout for individual compile test - add a xfail test case to ensure the timeout mechanism is working Co-authored-by: liushuyu <liushuyu011@gmail.com>
2022-04-15Merge #1116bors[bot]5-49/+40
1116: Move `cfg!()` macro to builtins. Fixes #1039 r=CohenArthur a=antego Fixes #1039 Hey team, I need help understanding why the test fails. Compilation succeeds, all the existing tests pass. However the test that I've added fails with the error: ``` FAIL: rust/compile/cfg_macro.rs (test for excess errors) Excess errors: /Users/anton/Documents/projects/gcc2/gccrs/gcc/testsuite/rust/compile/cfg_macro.rs:17:8: fatal error: Failed to lower expr: [MacroInvocation: outer attributes: none cfg!((A)) has semicolon: false] compilation terminated. ``` I tried to understand what's happening using a debugger. The only thing that I understood is that the `MacroBuiltin::cfg` function runs. Appreciate any feedback. Thank you. Co-authored-by: antego <antego@users.noreply.github.com>
2022-04-15Move cfg!() macro to builtinsantego5-49/+40
Fixes #1039
2022-04-14privacy: reachability: Visit all variants of an Enum and their fieldsArthur Cohen1-0/+32
2022-04-14hir: Add `EnumItemKind` enum for EnumItem classesArthur Cohen2-2/+41
2022-04-14privacy: reachability: wip: Update all base reach levelsArthur Cohen1-4/+19
2022-04-14Merge #1110bors[bot]2-42/+87
1110: Add Reachability visitors for items with generics r=CohenArthur a=CohenArthur This factors generics' predicates visiting in the `ReachabilityVisitor` and calls the function in other items with generic parameters Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
2022-04-14Merge #1113bors[bot]5-0/+119
1113: macros: Add env! macro r=CohenArthur a=omachota Added the `env!()` macro and relevant test cases Fixes: #977 Signed-off-by: Ondřej Machota <ondrejmachota@gmail.com> Co-authored-by: Ondřej Machota <ondrejmachota@gmail.com>
2022-04-13macros: Add env! macroOndřej Machota5-0/+119
Signed-off-by: Ondřej Machota <ondrejmachota@gmail.com>
2022-04-13Merge #1088bors[bot]11-11/+170
1088: rust-session-manager: better crate name handling logic r=philberty a=liushuyu - rust-session-manager: set and validate crate name properly - testsuite/rust: fix the testcases and add more testcases for testing crate name handling Co-authored-by: liushuyu <liushuyu011@gmail.com>
2022-04-13privacy: reachability: Add base visitor for items with generic paramsArthur Cohen2-22/+58
Co-authored-by: philberty <philip.herron@embecosm.com>
2022-04-13privacy: reachability: Cleanup Struct definition visitorArthur Cohen2-33/+42
2022-04-13Merge #1111bors[bot]4-37/+45
1111: Add AST Private Visibilities r=CohenArthur a=CohenArthur When parsing a visibility in `parse_visibility`, it is not an error to not have a pub token: It simply means we want to create a private visibility. If we had C++14 or another language, we could instead represent all visibilities as an optional<AST::Visibility> where the Visibility class would not need to change. But I think the best course of action for our case is to instead keep visibilities even when they are private and have a special case in the `VisKind` enumeration. This also enables HIR lowering of visibilities to be performed properly for private items Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
2022-04-13Merge #1114bors[bot]1-1/+1
1114: rust: Use -Otarget when building and logging warnings r=philberty a=simonpcook This will provide some synchronization for output lines, and so will make comparisons with known warnings as part of CI more reliable. Co-authored-by: Simon Cook <simon.cook@embecosm.com>
2022-04-13rust-session-manager: address more commentsliushuyu2-22/+32
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com> Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
2022-04-13visibility: Add create_private() static functionArthur Cohen4-37/+45
When parsing a visibility in `parse_visibility`, it is not an error to not have a pub token: It simply means we want to create a private visibility. If we had C++14 or another language, we could instead represent all visibilities as an optional<AST::Visibility> where the Visibility class would not need to change. But I think the best course of action for our case is to instead keep visibilities even when they are private and have a special case in the `VisKind` enumeration.
2022-04-13Merge #1112bors[bot]1-0/+54
1112: rust: Clang/macOS Testing r=philberty a=simonpcook This adds a version of the build-and-check job that runs with clang on macOS. Co-authored-by: Simon Cook <simon.cook@embecosm.com>
2022-04-13rust: Use -Otarget when building and logging warningsSimon Cook1-1/+1
This will provide some synchronization for output lines, and so will make comparisons with known warnings as part of CI more reliable.
2022-04-12rust-session-manager: address comments ...liushuyu6-44/+89
... also more closely match rustc's behavior Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
2022-04-12testsuite/rust: adapt/fix the testcases ...liushuyu9-2/+32
... so that the tests will still pass after the crate name logic change Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
2022-04-12rust-session-manager: set and validate crate name properly ...liushuyu2-6/+80
... should fix #789 Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
2022-04-12rust: Clang/macOS TestingSimon Cook1-0/+54
This adds a version of the build-and-check job that runs with clang on macOS.
2022-04-12Merge #1109bors[bot]23-47/+22
1109: rust: Allow gccrs to build on x86_64-apple-darwin with clang/libc++ r=CohenArthur a=simonpcook This makes changes to the includes such that gccrs can be built with clang/libc++, and for x86_64-apple-darwin. Similarly, a couple of changes have been made to creating MacroInvocations and wrapping into ExprOrStmts for libc++ compatibility. Co-authored-by: Simon Cook <simon.cook@embecosm.com>
2022-04-12rust: Allow gccrs to build on x86_64-apple-darwin with clang/libc++Simon Cook23-47/+22
This makes changes to the includes such that gccrs can be built with clang/libc++, and for x86_64-apple-darwin. Similarly, a couple of changes have been made to creating MacroInvocations and wrapping into ExprOrStmts for libc++ compatibility.
2022-04-12Merge #1082bors[bot]14-9/+591
1082: Add base for privacy visitor r=CohenArthur a=CohenArthur This PR is extremely early and implements some building blocks for privacy visitors. I'd like to get some feedback on the architecture and, if satisfactory, merge this first "visitor" which only takes care of visiting HIR struct definitions, to make reviewing easier. We could also merge it to a different branch for now, in order to not add an incomplete pass to the compiler. Thanks! Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
2022-04-12Merge #1108bors[bot]1-0/+60
1108: Add missing unify rules for inference variables r=philberty a=philberty Inference variables can unify with anything so this includes these covariant types like references/slices etc. This patch is needed for more complex type-checking in libcore and generics. Co-authored-by: Philip Herron <philip.herron@embecosm.com>
2022-04-12Merge #1106bors[bot]2-5/+9
1106: macros: fix an infinite loop in `concat!` macro parser r=CohenArthur a=liushuyu - Fix concat macro parser issue which caused an infinite loop when invalid token is encountered Co-authored-by: liushuyu <liushuyu011@gmail.com>
2022-04-12privacy: reachability: Visit all types of a struct's public fieldsArthur Cohen1-7/+4
2022-04-12privacy: reachability: Visit all struct generic predicatesArthur Cohen4-9/+38
2022-04-12typectx: Mark lookup_type() method as constArthur Cohen2-2/+2
2022-04-12privacy: Keep DefIds in reachability map insteadArthur Cohen3-5/+19
This commit also specialized `std::hash<DefId>` to be able to use it as key in {unordered_}maps
2022-04-12hir: Keep BaseKind enum inside the Node classArthur Cohen4-26/+27
Co-authored-by: philberty <philip.herron@embecosm.com>
2022-04-12privacy: reachability: Add base for visiting struct definitionsArthur Cohen1-4/+25
2022-04-12hir: StructField: Add `get_visibility()` methodArthur Cohen1-0/+2
2022-04-12privacy: reachability: Add better implementation for StructStructArthur Cohen2-7/+8
2022-04-12privacy: reachability: Add `maybe_get_vis_item` helper static functionArthur Cohen1-8/+16
2022-04-12Add missing unify rules for inference variablesPhilip Herron1-0/+60
Inference variables can unify with anything so this includes these covariant types like references/slices etc. This patch is needed for more complex type-checking in libcore and generics.
2022-04-12privacy: ctx: Add proper implementations for insert_reachability() andArthur Cohen4-11/+88
lookup_reachability() Inserting reach levels in the reachability_map should only be done if the existing reach level is lower than the provided one. If the node is not yet present in the reachability map, insert it no matter what
2022-04-12hir: Visibility: Add is_public() methodArthur Cohen1-0/+3
2022-04-12privacy: reach: Rename ReachLevel enumArthur Cohen3-5/+8
2022-04-12privacy: Add base for privacy-related visitorsArthur Cohen8-0/+373
2022-04-12hir: Add `Kind` enum to downcast safelyArthur Cohen2-7/+60
2022-04-12Merge #1103bors[bot]12-121/+120
1103: Lower AST::Visibility to HIR::Visibility properly r=CohenArthur a=CohenArthur Fixes #1093 This should cover every case since the previous code simply created public HIR visibilities. The PR refactors the HIR::Visibility struct to be tinier and a desugared version of the AST one. Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
2022-04-12Merge #1086bors[bot]22-307/+833
1086: Slice support r=philberty a=philberty Please see the commit a8de089969cb45199008027cd8d1b80dff25746f for a long explanation of what's going on in the patch. Unfortunately, I have not been able to split this patch up anymore since supporting slices exposed many bugs in the implementation of generics in general never main the missing support for generic associated types. Fixes #849 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
2022-04-12macros: fix an infinite loop ...liushuyu2-5/+9
... introduced in fed5a41fb1c2c91b77297fdd6d3731078f480441, should fix #1102 Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
2022-04-11testsuite/rust: add a xfail test case ...liushuyu1-0/+10
... to show case the timeout system is working