Skip to content

Commit

Permalink
[TEST ONLY] Enable preview=in by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Geod24 committed Mar 3, 2023
1 parent f49a606 commit a3c1968
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dmd/globals.d
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ extern (C++) struct Param
// https://digitalmars.com/d/archives/digitalmars/D/Binding_rvalues_to_ref_parameters_redux_325087.html
// Implementation: https://github.com/dlang/dmd/pull/9817
FeatureState noSharedAccess; // read/write access to shared memory objects
bool previewIn; // `in` means `[ref] scope const`, accepts rvalues
bool previewIn = true; // `in` means `[ref] scope const`, accepts rvalues
bool inclusiveInContracts; // 'in' contracts of overridden methods must be a superset of parent contract
bool shortenedMethods = true; // allow => in normal function declarations
bool fixImmutableConv; // error on unsound immutable conversion - https://github.com/dlang/dmd/pull/14070
Expand Down
4 changes: 2 additions & 2 deletions compiler/test/fail_compilation/deprecatedinref.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
REQUIRED_ARGS: -de
TEST_OUTPUT:
---
fail_compilation/deprecatedinref.d(9): Deprecation: using `in ref` is deprecated, use `-preview=in` and `in` instead
fail_compilation/deprecatedinref.d(10): Deprecation: using `ref in` is deprecated, use `-preview=in` and `in` instead
fail_compilation/deprecatedinref.d(9): Error: attribute `ref` is redundant with previously-applied `in`
fail_compilation/deprecatedinref.d(10): Error: attribute `in` cannot be added after `ref`: remove `ref`
---
*/
void foo(in ref int);
Expand Down
8 changes: 4 additions & 4 deletions compiler/test/fail_compilation/fail183.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
TEST_OUTPUT:
---
fail_compilation/fail183.d(17): Error: attribute `const` is redundant with previously-applied `in`
fail_compilation/fail183.d(18): Error: attribute `scope` cannot be applied with `in`, use `-preview=in` instead
fail_compilation/fail183.d(18): Error: attribute `scope` is redundant with previously-applied `in`
fail_compilation/fail183.d(19): Error: attribute `const` is redundant with previously-applied `in`
fail_compilation/fail183.d(19): Error: attribute `scope` cannot be applied with `in`, use `-preview=in` instead
fail_compilation/fail183.d(20): Error: attribute `scope` cannot be applied with `in`, use `-preview=in` instead
fail_compilation/fail183.d(19): Error: attribute `scope` is redundant with previously-applied `in`
fail_compilation/fail183.d(20): Error: attribute `scope` is redundant with previously-applied `in`
fail_compilation/fail183.d(20): Error: attribute `const` is redundant with previously-applied `in`
fail_compilation/fail183.d(22): Error: attribute `in` cannot be added after `const`: remove `const`
fail_compilation/fail183.d(23): Error: attribute `in` cannot be added after `scope`: remove `scope` and use `-preview=in`
fail_compilation/fail183.d(23): Error: attribute `in` cannot be added after `scope`: remove `scope`
fail_compilation/fail183.d(24): Error: attribute `in` cannot be added after `const`: remove `const`
fail_compilation/fail183.d(25): Error: attribute `in` cannot be added after `const`: remove `const`
---
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/run.d
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Options:
args = ["all"];

// move any long-running tests to the front
static size_t sortKey(in ref Target target)
static size_t sortKey(const scope ref Target target)
{
const name = target.normalizedTestName;
if (name.startsWith("runnable"))
Expand Down

0 comments on commit a3c1968

Please sign in to comment.