summary refs log tree commit diff
path: root/src/libstd/env.rs
AgeCommit message (Collapse)AuthorLines
2017-11-07Warn about non-portability of glob patternsKornel-0/+4
2017-06-24Move global vars changing tests into run-passStepan Koltsov-81/+1
Should fix race #42795
2017-06-22Auto merge of #42798 - stepancheg:args-debug, r=sfacklerbors-2/+16
Better Debug for Args and ArgsOs Display actual args instead of two dots.
2017-06-21Better Debug for Args and ArgsOsStepan Koltsov-2/+16
Display actual args instead of two dots.
2017-06-20Add a couple doc additional examples for `env::join_paths`.Corey Farwell-0/+29
2017-06-12Rollup merge of #42579 - maccoda:maccoda/env_docs, r=steveklabnikCorey Farwell-9/+11
env docs completion. Should be closing #29351 with the alignment of the iterators to the template.
2017-06-10env docs completion.Dylan Maccora-9/+11
2017-05-20Rollup merge of #42091 - maccoda:maccoda/env_docs, r=frewsxcvMark Simulacrum-16/+33
Improving std::env docs Addresses #29351. Hopefully this addresses the following points: > - iterators should use the standard iterator boilerplate like https://doc.rust-lang.org/std/iter/struct.Map.html, this applies to all structs except for JoinPathsError > - JoinPathsError should properly link the function it comes from and use language similar to https://doc.rust-lang.org/std/io/struct.Error.html > - same wording issues with VarError > - functions need to ensure linkage to things they refer to in their descriptions > - Explain the difference between `os` and non-`os` structs and methods
2017-05-20Auto merge of #42111 - ollie27:stab, r=Mark-Simulacrumbors-2/+2
Correct some stability versions These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
2017-05-20Correct some stability versionsOliver Middleton-2/+2
These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
2017-05-20Merge branch 'master' into maccoda/env_docsDylan Maccora-7/+10
2017-05-20Fixed link issue.Dylan Maccora-2/+2
2017-05-18std::env docsDylan Maccora-18/+35
2017-05-18misc doc improvements for std::envTshepang Lekhonkhobe-9/+12
2017-03-05clarify docs for Args and ArgsOsJack O'Connor-0/+8
The args() and args_os() docs include a line about how the first element is usually the program name. Include that line in the struct docs too.
2017-02-18Add missing urls for env functionsGuillaume Gomez-4/+11
2017-02-08Add missing urls on join_pathsGuillaume Gomez-4/+8
2017-02-07Add missing urls for current_dirGuillaume Gomez-2/+5
2017-01-29Fix a few impl stability attributesOliver Middleton-5/+5
The versions show up in rustdoc.
2017-01-27Fix a few links in the docsOliver Middleton-1/+1
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-1/+1
See #38644.
2017-01-12Minor improvements to docs in std::env structures/functions.Corey Farwell-8/+12
* Call functions "functions" instead of "methods". * Link structures to their constructor functions * Add other misc. documentation links
2016-12-29libstd: define std::env::consts::ARCH for sparc64Jonathan A. Kollasch-0/+6
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+36
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-04std: Forward ExactSizeIterator::is_empty for Args, ArgsOs iteratorsUlrik Sverdrup-0/+2
2016-11-21Add some internal docs links for Args/ArgsOsJohn Downey-5/+13
2016-10-02Move platform-specific arg handling to sys::argsBrian Anderson-2/+3
2016-10-01std: Move platform specific env code into sysBrian Anderson-183/+9
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+3
2016-09-30Preliminary wasm32 supportBrian Anderson-1/+17
2016-09-25Add support for the Haiku operating system on x86 and x86_64 machinesNiels Sascha Reedijk-0/+11
* Hand rebased from Niels original work on 1.9.0
2016-09-14doc: make that sound betterTshepang Lekhonkhobe-2/+2
2016-09-09Add s390x supportUlrich Weigand-0/+6
This adds support for building the Rust compiler and standard library for s390x-linux, allowing a full cross-bootstrap sequence to complete. This includes: - Makefile/configure changes to allow native s390x builds - Full Rust compiler support for the s390x C ABI (only the non-vector ABI is supported at this point) - Port of the standard library to s390x - Update the liblibc submodule to a version including s390x support - Testsuite fixes to allow clean "make check" on s390x Caveats: - Resets base cpu to "z10" to bring support in sync with the default behaviour of other compilers on the platforms. (Usually, upstream supports all older processors; a distribution build may then chose to require a more recent base version.) (Also, using zEC12 causes failures in the valgrind tests since valgrind doesn't fully support this CPU yet.) - z13 vector ABI is not yet supported. To ensure compatible code generation, the -vector feature is passed to LLVM. Note that this means that even when compiling for z13, no vector instructions will be used. In the future, support for the vector ABI should be added (this will require common code support for different ABIs that need different data_layout strings on the same platform). - Two test cases are (temporarily) ignored on s390x to allow passing the test suite. The underlying issues still need to be fixed: * debuginfo/simd.rs fails because of incorrect debug information. This seems to be a LLVM bug (also seen with C code). * run-pass/union/union-basic.rs simply seems to be incorrect for all big-endian platforms. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-02Auto merge of #36024 - japaric:mips64, r=alexcrichtonbors-0/+6
add mips64-gnu and mips64el-gnu targets With this commit one can build no_core (and probably no_std as well) Rust programs for these targets. It's not yet possible to cross compile std for these targets because rust-lang/libc doesn't know about the mips64 architecture. These targets have been tested by cross compiling the "smallest hello" program (see code below) and then running it under QEMU. ``` rust extern { fn puts(_: *const u8); } fn start(_: isize, _: *const *const u8) -> isize { unsafe { let msg = b"Hello, world!\0"; puts(msg as *const _ as *const u8); } 0 } trait Copy {} trait Sized {} ``` cc #36015 r? @alexcrichton cc @brson The cabi stuff is likely wrong. I just copied cabi_mips source and changed some `4`s to `8`s and `32`s to `64`s. It was enough to get libc's `puts` to work but I'd like someone familiar with this module to check it.
2016-08-27fix cross compilation of stdJorge Aparicio-0/+6
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-3/+0
2016-08-14Rollup merge of #34941 - qolop:patch-2, r=apasel422Eduard-Mihai Burtescu-2/+2
Fix typo (privledge->privilege)
2016-08-11Fix typoPatrick McCann-1/+1
Didn't see this one at first.
2016-07-27Auto merge of #33312 - Byron:double-ended-iterator-for-args, r=alexcrichtonbors-0/+11
DoubleEndedIterator for Args This PR implements the DoubleEndedIterator trait for the `std::env::Args[Os]` structure, as well as the internal implementations. It is primarily motivated by me, as I happened to implement a simple `reversor` program many times now, which so far had to use code like this: ```Rust for arg in std::env::args().skip(1).collect::<Vec<_>>().iter().rev() {} ``` ... even though I would have loved to do this instead: ```Rust for arg in std::env::args().skip(1).rev() {} ``` The latter is more natural, and I did not find a reason for not implementing it. After all, on every system, the number of arguments passed to the program are known at runtime. To my mind, it follows KISS, and does not try to be smart at all. Also, there are no unit-tests, primarily as I did not find any existing tests for the `Args` struct either. The windows implementation is basically a copy-pasted variant of the `next()` method implementation, and I could imagine sharing most of the code instead. Actually I would be happy if the reviewer would ask for it.
2016-07-26DoubleEndedIterator for ArgsSebastian Thiel-0/+11
The number of arguments given to a process is always known, which makes implementing DoubleEndedIterator possible. That way, the Iterator::rev() method becomes usable, among others. Signed-off-by: Sebastian Thiel <byronimo@gmail.com> Tidy for DoubleEndedIterator I chose to not create a new feature for it, even though technically, this makes me lie about the original availability of the implementation. Verify with @alexchrichton Setup feature flag for new std::env::Args iterators Add test for Args reverse iterator It's somewhat depending on the input of the test program, but made in such a way that should be somewhat flexible to changes to the way it is called. Deduplicate windows ArgsOS code for DEI DEI = DoubleEndedIterator Move env::args().rev() test to run-pass It must be controlling it's arguments for full isolation. Remove superfluous feature name Assert all arguments returned by env::args().rev() Let's be very sure it works as we expect, why take chances. Fix rval of os_string_from_ptr A trait cannot be returned, but only the corresponding object. Deref pointers to actually operate on the argument Put unsafe to correct location
2016-07-20Fix typo (privledge->privilege)Patrick McCann-1/+1
2016-07-20Auto merge of #33526 - steveklabnik:gh21889, r=alexcrichtonbors-0/+38
Add some warnings to std::env::current_exe /cc #21889 @rust-lang/libs @semarie I started writing this up. I'm not sure if we want to go into other things and in what depth; we don't currently have a lot of security-specific documentation to model after. Thoughts?
2016-07-19re-work exampleSteve Klabnik-12/+35
2016-05-12Cleanup formatting and wording for `std::env::temp_dir` docs.Corey Farwell-10/+10
2016-05-09Add some warnings to std::env::current_exeSteve Klabnik-0/+15
/cc #21889
2016-04-06Rollup merge of #32691 - frewsxcv:patch-28, r=alexcrichtonSteve Klabnik-1/+1
Indicate `None` is code-like in doc comment.
2016-04-06Rollup merge of #31762 - tshepang:in-which-case, r=steveklabnikSteve Klabnik-8/+8
doc: there is no case that is shown, so something was likely missing … …from the change
2016-04-05doc: make env::consts summaries less confusingTshepang Lekhonkhobe-8/+8
2016-04-02Indicate `None` is code-like in doc comment.Corey Farwell-1/+1
2016-03-30doc: "of the" seems more correct than "to the"Tshepang Lekhonkhobe-8/+8
It's also less ambiguous