Skip to content

Commit

Permalink
Merge pull request #1998 from vibe-d/remove_compatibility_code
Browse files Browse the repository at this point in the history
Remove 2.071.x compatibility code
merged-on-behalf-of: Sönke Ludwig <[email protected]>
  • Loading branch information
dlang-bot authored Dec 12, 2017
2 parents dc634d8 + e923586 commit 935385a
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ matrix:

before_install:
- pyenv global system 3.5
- pip3 install 'meson>=0.42,!=0.43'
- pip3 install 'meson>=0.42,!=0.43,!=0.44'

install:
- mkdir .ntmp
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,20 @@ Support
Vibe.d aims to support at least the 3 latest minor releases of D.
At the moment, the following compilers are supported and tested:

- DMD 2.077.0
- DMD 2.077.1
- DMD 2.076.1
- DMD 2.075.1
- DMD 2.074.1
- DMD 2.073.2
- DMD 2.072.2 **Warning: 2.072.0 and 2.072.1 are affected by a serious DMD regression: [16980](https://issues.dlang.org/show_bug.cgi?id=16980)**
- DMD 2.071.2
- LDC 1.6.0 (FE: 2.076.1)
- LDC 1.5.0 (FE: 2.075.1)
- LDC 1.4.0 (FE: 2.074.1)
- LDC 1.3.0 (FE: 2.073.2)
- LDC 1.2.0 (FE: 2.072.2)

Up to 0.8.1:
- DMD 2.071.2
- LDC 1.1.1 (FE: 2.071.2)

Up to 0.8.0:
Expand Down
5 changes: 1 addition & 4 deletions core/vibe/internal/freelistref.d
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@ in {

// Initialize the object in its pre-ctor state
() @trusted {
static if (__VERSION__ < 2071)
chunk[0 .. classSize] = typeid(T).init[];
else
chunk[0 .. classSize] = typeid(T).initializer[]; // Avoid deprecation warning
chunk[0 .. classSize] = typeid(T).initializer[]; // Avoid deprecation warning
} ();

// Call the ctor if any
Expand Down
5 changes: 1 addition & 4 deletions textfilter/vibe/textfilter/urlencode.d
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,7 @@ private struct StringSliceAppender(S) {
{
import std.encoding : encode;
char[6] chars;
static if (__VERSION__ < 2072)
auto n = () @trusted { return encode(ch, chars[]); } ();
else
auto n = encode(ch, chars[]);
auto n = encode(ch, chars[]);
foreach (char c; chars[0 .. n]) put(c);
}

Expand Down
5 changes: 1 addition & 4 deletions utils/vibe/internal/memory_legacy.d
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,7 @@ in {
auto result = cast(T) chunk.ptr;

// Initialize the object in its pre-ctor state
static if (__VERSION__ < 2071)
chunk[0 .. classSize] = typeid(T).init[];
else
chunk[0 .. classSize] = typeid(T).initializer[]; // Avoid deprecation warning
chunk[0 .. classSize] = typeid(T).initializer[]; // Avoid deprecation warning

// Call the ctor if any
static if (is(typeof(result.__ctor(args))))
Expand Down
7 changes: 2 additions & 5 deletions utils/vibe/internal/meta/funcattr.d
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ unittest {
*/
auto computeAttributedParameter(alias FUNCTION, string NAME, ARGS...)(ARGS args)
{
import std.typetuple : Filter;
import std.meta : Filter;
static assert(IsAttributedParameter!(FUNCTION, NAME), "Missing @before attribute for parameter "~NAME);
alias input_attributes = Filter!(isInputAttribute, RecursiveFunctionAttributes!FUNCTION);
foreach (att; input_attributes)
Expand All @@ -203,10 +203,7 @@ auto computeAttributedParameter(alias FUNCTION, string NAME, ARGS...)(ARGS args)
*/
auto computeAttributedParameterCtx(alias FUNCTION, string NAME, T, ARGS...)(T ctx, ARGS args)
{
static if (__VERSION__ >= 2072)
import std.typetuple : AliasSeq, Filter;
else
import std.typetuple : AliasSeq = TypeTuple, Filter;
import std.meta : AliasSeq, Filter;
static assert(IsAttributedParameter!(FUNCTION, NAME), "Missing @before attribute for parameter "~NAME);
alias input_attributes = Filter!(isInputAttribute, RecursiveFunctionAttributes!FUNCTION);
foreach (att; input_attributes)
Expand Down
5 changes: 1 addition & 4 deletions utils/vibe/internal/utilallocator.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ final class RegionListAllocator(Allocator, bool leak = false) : IAllocator {
import std.algorithm.comparison : min, max;
import std.conv : emplace;

static if (__VERSION__ < 2072)
import stdx.allocator.common : Ternary;
else
import std.typecons : Ternary;
import std.typecons : Ternary;

static struct Pool { Pool* next; void[] data; void[] remaining; }
private {
Expand Down
6 changes: 0 additions & 6 deletions utils/vibe/utils/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,6 @@ struct ArraySet(Key)

~this()
@trusted {
static if (__VERSION__ <= 2071)
scope (failure) assert(false);
if (m_entries.ptr) {
if (--allocator.prefix(m_entries) <= 0) {
try allocator.dispose(m_entries);
Expand All @@ -594,17 +592,13 @@ struct ArraySet(Key)

this(this)
@trusted {
static if (__VERSION__ <= 2071)
scope (failure) assert(false);
if (m_entries.ptr) {
allocator.prefix(m_entries)++;
}
}

@property ArraySet dup()
{
static if (__VERSION__ <= 2071)
scope (failure) assert(false);
ArraySet ret;
ret.m_staticEntries = m_staticEntries;
ret.m_allocator = m_allocator;
Expand Down
8 changes: 3 additions & 5 deletions utils/vibe/utils/validation.d
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ bool validateEmail(R)(ref R error_sink, string str, size_t max_length = 64)
return false;
}

static if (__VERSION__ >= 2072) {
if (() @trusted { return !isEmail(str); }()) {
error_sink.put("The email address is invalid.");
return false;
}
if (() @trusted { return !isEmail(str); }()) {
error_sink.put("The email address is invalid.");
return false;
}

return true;
Expand Down

0 comments on commit 935385a

Please sign in to comment.