- 15 5月, 2014 24 次提交
-
-
由 Aaron Turon 提交于
The existing APIs for spawning processes took strings for the command and arguments, but the underlying system may not impose utf8 encoding, so this is overly limiting. The assumption we actually want to make is just that the command and arguments are viewable as [u8] slices with no interior NULLs, i.e., as CStrings. The ToCStr trait is a handy bound for types that meet this requirement (such as &str and Path). However, since the commands and arguments are often a mixture of strings and paths, it would be inconvenient to take a slice with a single T: ToCStr bound. So this patch revamps the process creation API to instead use a builder-style interface, called `Command`, allowing arguments to be added one at a time with differing ToCStr implementations for each. The initial cut of the builder API has some drawbacks that can be addressed once issue #13851 (libstd as a facade) is closed. These are detailed as FIXMEs. Closes #11650. [breaking-change]
-
由 Aaron Turon 提交于
This is a stopgap until DST (#12938) lands. Until DST lands, we cannot decompose &str into & and str, so we cannot usefully take ToCStr arguments by reference (without forcing an additional & around &str). So we are instead temporarily adding an instance for &Path and StrBuf, so that we can take ToCStr as owned. When DST lands, the &Path instance should be removed, the string instances should be revisted, and arguments bound by ToCStr should be passed by reference. FIXMEs have been added accordingly.
-
由 bors 提交于
r? @brson
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 Patrick Walton 提交于
-
由 bors 提交于
Provides better help for the resolve failures inside an `impl` if the name matches: - a field on the self type - a method on the self type - a method on the current trait ref (in a trait impl) Not handling trait method suggestions if in a regular `impl` (as you can see on line 69 of the test), I believe it is possible though. Also, provides a better message when `self` fails to resolve due to being a static method. It's using some unsafe pointers to skip copying the larger structures (which are only used in error conditions); it's likely possible to get it working with lifetimes (all the useful refs should outlive the visitor calls) but I haven't really figured that out for this case. (can switch to copying code if wanted) Closes #2356.
-
由 Kevin Butler 提交于
-
由 bors 提交于
I feel that this is a very vital, missing piece of functionality. This adds on to #13072. Only bits used in the definition of the bitflag are considered for the universe set. This is a bit safer than simply inverting all of the bits in the wrapped value. ```rust bitflags!(flags Flags: u32 { FlagA = 0x00000001, FlagB = 0x00000010, FlagC = 0x00000100, FlagABC = FlagA.bits | FlagB.bits | FlagC.bits }) ... // `Not` implements set complement assert!(!(FlagB | FlagC) == FlagA); // `all` and `is_all` are the inverses of `empty` and `is_empty` assert!(Flags::all() - FlagA == !FlagA); assert!(FlagABC.is_all()); ```
-
- 14 5月, 2014 16 次提交
-
-
由 bors 提交于
Fixes #14134
-
由 bors 提交于
We were correctly determining the attributes needed for the parameters for extern fns, but when that extern fn was from another crate we never bothered to pass that information along to LLVM. (i.e never called `foreign::add_argument_attributes`). I've just changed both local and non-local (crate) extern fn's to be dealt with together (through `foreign::register_foreign_item_fn`) so we don't run into something like again. Fixes #14177.
-
由 bors 提交于
-
由 bors 提交于
It's a bit odd to single out just android when we don't do this for any other cross compiling targets. Android builds will still work since we just pass the full path for gcc and ar with `-C linker` and `-C ar`. I did add the flag to compiletest though so it can find gdb. Though, i'm pretty sure we don't run debuginfo tests on android anyways right now. [breaking-change]
-
由 J.C. Moyer 提交于
-
由 bors 提交于
This module is a foundation on which many other algorithms are built. When hardware support is missing, stubs are provided in libcompiler-rt.a, so this should be available on all platforms.
-
由 Alex Crichton 提交于
Due to our excellent macro hygiene, this involves having a global path and a hidden module in libcore itself.
-
由 Alex Crichton 提交于
Explain why it should not exist, and the plan of attack for removing it.
-
由 Alex Crichton 提交于
-
由 Alex Crichton 提交于
-
由 Michael Darakananda 提交于
-
由 Luqman Aden 提交于
-
由 Luqman Aden 提交于
There's no need to include this specific flag just for android. We can already deal with what it tries to solve by using -C linker=/path/to/cc and -C ar=/path/to/ar. The Makefiles for rustc already set this up when we're crosscompiling. I did add the flag to compiletest though so it can find gdb. Though, I'm pretty sure we don't run debuginfo tests on android anyways right now. [breaking-change]
-
由 bors 提交于
It was thought that these failures only happened on windows, turns out they happen on any 32-bit machine. cc #14064
-
由 bors 提交于
Reader.read_at_least() ensures that at least a given number of bytes have been read. The most common use-case for this is ensuring at least 1 byte has been read. If the reader returns 0 enough times in a row, a new error kind NoProgress will be returned instead of looping infinitely. This change is necessary in order to properly support Readers that repeatedly return 0, either because they're broken, or because they're attempting to do a non-blocking read on some resource that never becomes available. Also add .push() and .push_at_least() methods. push() is like read() but the results are appended to the passed Vec. Remove Reader.fill() and Reader.push_exact() as they end up being thin wrappers around read_at_least() and push_at_least(). [breaking-change]
-
由 Kevin Ballard 提交于
Reader.read_at_least() ensures that at least a given number of bytes have been read. The most common use-case for this is ensuring at least 1 byte has been read. If the reader returns 0 enough times in a row, a new error kind NoProgress will be returned instead of looping infinitely. This change is necessary in order to properly support Readers that repeatedly return 0, either because they're broken, or because they're attempting to do a non-blocking read on some resource that never becomes available. Also add .push() and .push_at_least() methods. push() is like read() but the results are appended to the passed Vec. Remove Reader.fill() and Reader.push_exact() as they end up being thin wrappers around read_at_least() and push_at_least(). [breaking-change]
-