diff --git a/compiler/src/dmd/globals.d b/compiler/src/dmd/globals.d index 901561fcf8e..7fd3fc3ef59 100644 --- a/compiler/src/dmd/globals.d +++ b/compiler/src/dmd/globals.d @@ -198,7 +198,7 @@ extern (C++) struct Param FeatureState safer; // safer by default (more @safe checks in unattributed code) // https://github.com/WalterBright/documents/blob/38f0a846726b571f8108f6e63e5e217b91421c86/safer.md 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 diff --git a/compiler/test/compilable/testfptr.d b/compiler/test/compilable/testfptr.d index e6a0dd670df..d9a375c69c6 100644 --- a/compiler/test/compilable/testfptr.d +++ b/compiler/test/compilable/testfptr.d @@ -107,17 +107,12 @@ void bug3797() static assert(!is(typeof( purefunc = nonpurefunc ))); static assert( is(typeof( nonpurefunc = purefunc ))); - // Cannot convert parameter storage classes (except const to in and in to const) - - void function(const(int)) constfunc; + // Cannot convert parameter storage classes void function(in int) infunc; void function(out int) outfunc; void function(ref int) reffunc; void function(lazy int) lazyfunc; - static assert(is(typeof( infunc = constfunc ))); - static assert(is(typeof( constfunc = infunc ))); - static assert(!is(typeof( infunc = outfunc ))); static assert(!is(typeof( infunc = reffunc ))); static assert(!is(typeof( infunc = lazyfunc ))); @@ -250,17 +245,12 @@ void bug3797dg() static assert(!is(typeof( purefunc = nonpurefunc ))); static assert( is(typeof( nonpurefunc = purefunc ))); - // Cannot convert parameter storage classes (except const to in and in to const) - - void delegate(const(int)) constfunc; + // Cannot convert parameter storage classes void delegate(in int) infunc; void delegate(out int) outfunc; void delegate(ref int) reffunc; void delegate(lazy int) lazyfunc; - static assert(is(typeof( infunc = constfunc ))); - static assert(is(typeof( constfunc = infunc ))); - static assert(!is(typeof( infunc = outfunc ))); static assert(!is(typeof( infunc = reffunc ))); static assert(!is(typeof( infunc = lazyfunc ))); diff --git a/compiler/test/fail_compilation/deprecations_preview_in.d b/compiler/test/fail_compilation/deprecations_preview_in.d index 33cc904e4be..ed7d7d348e3 100644 --- a/compiler/test/fail_compilation/deprecations_preview_in.d +++ b/compiler/test/fail_compilation/deprecations_preview_in.d @@ -2,7 +2,7 @@ REQUIRED_ARGS: -de TEST_OUTPUT: --- -fail_compilation/deprecations_preview_in.d(1): Deprecation: using `in` parameters with `extern(C)` functions is deprecated +fail_compilation/deprecations_preview_in.d(1): Error: cannot use `in` parameters with `extern(C)` functions fail_compilation/deprecations_preview_in.d(1): parameter `__anonymous_param` declared as `in` here --- */ diff --git a/compiler/test/fail_compilation/fail183.d b/compiler/test/fail_compilation/fail183.d index 362213c1f64..b086893bf41 100644 --- a/compiler/test/fail_compilation/fail183.d +++ b/compiler/test/fail_compilation/fail183.d @@ -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` --- diff --git a/compiler/test/run.d b/compiler/test/run.d index efc5e3d9df2..655df2b3b99 100755 --- a/compiler/test/run.d +++ b/compiler/test/run.d @@ -163,7 +163,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"))