Skip to content

Conversation

@DmitryOlshansky
Copy link
Member

No description provided.

@dlang-bot
Copy link
Contributor

dlang-bot commented Sep 6, 2017

Thanks for your pull request, @DmitryOlshansky!

Bugzilla references

Auto-close Bugzilla Description
13348 std.uni.Grapheme is impure due to using C malloc and friends

std/uni.d Outdated
import std.traits; // isConvertibleToString, isIntegral, isSomeChar,
// isSomeString, Unqual
import std.exception : enforce, collectException;
import core.memory : pureMalloc, pureRealloc, pureFree;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use function local imports instead? There are still some issues with top level selective imports: https://issues.dlang.org/show_bug.cgi?id=17630

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly that was an attempt to solve linker error while using function local imports...

std/uni.d Outdated
// kill unrolled switches

private static bool isRegionalIndicator(dchar ch) @safe
private static bool isRegionalIndicator(dchar ch) @safe pure @nogc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothrow

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@DmitryOlshansky DmitryOlshansky changed the base branch from master to stable September 6, 2017 15:20
@DmitryOlshansky
Copy link
Member Author

@JackStouffer any ideas on how do I restart circle-ci test ?

@JackStouffer
Copy link
Contributor

This is one way

@JackStouffer JackStouffer reopened this Sep 6, 2017
@JackStouffer
Copy link
Contributor

huh, usually that works

cc @wilzbach

@PetarKirov
Copy link
Member

You can restart CircleCI by logging with your GitHub profile there. After that a Restart Build button should show. (I've just done so.)

Copy link
Member

@PetarKirov PetarKirov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, modulo some minor comments.

std/uni.d Outdated
See_Also: $(LREF Grapheme.valid)
+/
ref opOpAssign(string op)(dchar ch)
ref opOpAssign(string op)(dchar ch) pure @nogc
Copy link
Member

@PetarKirov PetarKirov Sep 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are pure and @nogc inferred if you remove them from the signature? If yes, can we remove them (I guess that they were useful to you when debugging the attributes on other code), if no, can you also add nothrow?

std/uni.d Outdated
entirely.
+/
@property bool valid()() /*const*/
@property bool valid()() pure @nogc/*const*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dittto - is keeping the attributes really necessary?

std/uni.d Outdated
}

this(this)
this(this) pure @nogc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothrow

std/uni.d Outdated
}

~this()
~this() pure @nogc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothrow

std/uni.d Outdated
}

void convertToBig()
void convertToBig() pure @nogc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothrow

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

std/uni.d Outdated

import std.exception : enforce, collectException;
import core.memory : pureMalloc, pureRealloc, pureFree;
import core.exception : onOutOfMemoryError;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error do you get if you make those imports function local? Also if you can't make them function local, you should make them non-selective as currently there's a compiler bug causing them to behave as they were public.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link errors pointing roughly in the direction of druntime. Will make non-selective.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you file a bug for this? I guess it would too hard to minimize by hand, so something along the lines of "At phobos commit xxxx, if the imports at file:line are made selective, I get this link error..." would be good enough.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tnx

Copy link
Member

@PetarKirov PetarKirov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@dlang-bot dlang-bot merged commit fde471f into dlang:stable Sep 7, 2017
import std.exception;// : enforce;
import core.memory; //: pureMalloc, pureRealloc, pureFree;
import core.exception; // : onOutOfMemoryError;
static import std.ascii;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error do you get if you make those imports function local? Also if you can't make them function local, you should make them non-selective as currently there's a compiler bug causing them to behave as they were public.

@ZombineDev It's the other way around: every new non-selective import we add, is public.
In other words, the following is now possible:

import std.uni : assumeUnique, pureMalloc; // ...

#5584 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I remembered that bug report backwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants