While usage of change_dir_locked is synchronized against itself, it's not
synchronized against other relative path usage, so I'm of the opinion that it
just really doesn't help in running tests. In order to prevent the problems that
have been cropping up, this completely removes the function.
All existing tests (except one) using it have been moved to run-pass tests where
they get their own process and don't need to be synchronized with anyone else.
There is one now-ignored rustpkg test because when I moved it to a run-pass test
apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having
linkage failures).
Since function pointers do not carry along the function attributes with
them in the type, this needs to be set on the call instruction itself.
Closes#9152
r? @brson As per rustpkg.md, rustpkg now builds in a target-specific
subdirectory of build/, and installs libraries into a target-specific
subdirectory of lib.
Closes#8672
The glob tests cannot change the current working directory because the other tests (namely the fileinput ones) depend on the current working directory not changing.
The normal unit tests cannot change the current working directory because it
messes with the other tests which depend on a particular working directory.
As per rustpkg.md, rustpkg now builds in a target-specific
subdirectory of build/, and installs libraries into a target-specific
subdirectory of lib.
Closes#8672
Since function pointers do not carry along the function attributes with
them in the type, this needs to be set on the call instruction itself.
Closes#9152
These tests are being very flaky on the bots, and the reason is that files are
being created and then when attempted to get read they actually don't exist. I'm
not entirely sure why this is happening, but I also don't fully trust the
std::io implemention using @-boxes to close/flush/write files at the right time.
This moves the tests to using std::rt::io which is hopefully more robust and
something that we can actually reason about. Sadly, due to #8810, these tests
fail on windows, so they're all ignored on windows right now.
Testing this is a little tricky as an intermediate temporary directory is only used for remote git repositories and therefore that path cannot be reliably exercised in the tests.
r? @metajack Install to the first directory in the RUST_PATH if the user set a
RUST_PATH. In the case where RUST_PATH isn't set, the behavior
remains unchanged.
Closes#7402
Install to the first directory in the RUST_PATH if the user set a
RUST_PATH. In the case where RUST_PATH isn't set, the behavior
remains unchanged.
Closes#7402
r? @brson Package IDs can now refer to a subdirectory of a particular source
tree, and not just a top-level directory with a src/ directory as its
parent.
For example, referring to the package ID a/b/c/d , in workspace W,
if W/src/a is a package, will build the sources for the package in
a/b/c/d (and not other crates in W/src/a).
Closes#6408
Package IDs can now refer to a subdirectory of a particular source
tree, and not just a top-level directory with a src/ directory as its
parent.
For example, referring to the package ID a/b/c/d , in workspace W,
if W/src/a is a package, will build the sources for the package in
a/b/c/d (and not other crates in W/src/a).
Closes#6408
This is mostly for consistency, as you can now compare raw pointers in
constant expressions or without the standard library.
It also reduces the number of `ptrtoint` instructions in the IR, making
tracking down culprits of what's usually an anti-pattern easier.
- Wrap calls into linenoise in a mutex so that the functions don't have to be `unsafe` any more (fixes#3921)
- Stop leaking every line that linenoise reads.
- Handle the situation of `rl::complete(some_function); do spawn { rl::read(""); }` which would crash (`fail!` that turned into an abort, possibly due to failing with the lock locked) when the user attempted to tab-complete anything.
- Add a test for the various functions; it has to be run by hand to verify anything works, but it won't bitrot.
The purpose of this macro is to further reduce the number of allocations which
occur when dealing with formatting strings. This macro will perform all of the
static analysis necessary to validate that a format string is safe, and then it
will wrap up the "format string" into an opaque struct which can then be passed
around.
Two safe functions are added (write/format) which take this opaque argument
structure, unwrap it, and then call the unsafe version of write/format (in an
unsafe block). Other than these two functions, it is not intended for anyone to
ever look inside this opaque struct.
The macro looks a bit odd, but mostly because of rvalue lifetimes this is the
only way for it to be safe that I know of.
Example use-cases of this are:
* third-party libraries can use the default formatting syntax without any
forced allocations
* the fail!() macro can avoid allocating the format string
* the logging macros can avoid allocation any strings
I plan on transitioning the standard logging/failing to using these macros soon. This is currently blocking on inner statics being usable in cross-crate situations (still tracking down bugs there), but this will hopefully be coming soon!
Additionally, I'd rather settle on a name now than later, so if anyone has a better suggestion other than `format_args`, I'm not attached to the name at all :)
These tests are being very flaky on the bots, and the reason is that files are
being created and then when attempted to get read they actually don't exist. I'm
not entirely sure why this is happening, but I also don't fully trust the
std::io implemention using @-boxes to close/flush/write files at the right time.
This moves the tests to using std::rt::io which is hopefully more robust and
something that we can actually reason about. Sadly, due to #8810, these tests
fail on windows, so they're all ignored on windows right now.
The purpose of this macro is to further reduce the number of allocations which
occur when dealing with formatting strings. This macro will perform all of the
static analysis necessary to validate that a format string is safe, and then it
will wrap up the "format string" into an opaque struct which can then be passed
around.
Two safe functions are added (write/format) which take this opaque argument
structure, unwrap it, and then call the unsafe version of write/format (in an
unsafe block). Other than these two functions, it is not intended for anyone to
ever look inside this opaque struct.
The macro looks a bit odd, but mostly because of rvalue lifetimes this is the
only way for it to be safe that I know of.
Example use-cases of this are:
* third-party libraries can use the default formatting syntax without any
forced allocations
* the fail!() macro can avoid allocating the format string
* the logging macros can avoid allocation any strings
This is mostly for consistency, as you can now compare raw pointers in
constant expressions or without the standard library.
It also reduces the number of `ptrtoint` instructions in the IR, making
tracking down culprits of what's usually an anti-pattern easier.
Fixes issues #5557 and #8746.
This patch adds an additional family for struct-like variants, and encodes some struct-like aspects of such variants that can then be properly decoded by resolve.
Note that I am not 100% sure how this fix works, but it fixes the issue without breaking any of the tests on my machine.