about summary refs log tree commit diff
path: root/src/libstd/env.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-1076/+0
2020-07-15Automatically calculate std::env::consts::ARCH.Eric Huss-76/+1
This simplifies the definition for ARCH. Note that this changes asmjs-unknown-emscripten ARCH to `wasm32`, which reflects the actual target arch.
2020-05-01Remove recommendation for unmaintained crateJacob Kiesel-1/+1
2020-03-19doc: Add quote to .init_arraylzutao-4/+4
2020-01-01Add support for RISC-V 64-bit GNU/Linuxmsizanoen1-0/+6
2019-12-28Change "be returning" to "return"Matthew Kraai-1/+1
2019-12-28Auto merge of #67605 - lzutao:msdn-links, r=Mark-Simulacrumbors-2/+2
tidy: change msdn links to newer locations see accouncement at https://docs.microsoft.com/welcome-to-docs The script that I used: https://gist.github.com/lzutao/1449c9210ad91899841d62e0058d2caa
2019-12-25tidy: change msdn links to newer locationsLzu Tao-2/+2
see accouncement at https://docs.microsoft.com/welcome-to-docs
2019-12-24Deprecate Error::description for realDavid Tolnay-0/+2
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-11-29Format libstd with rustfmtDavid Tolnay-67/+94
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libstd. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
2019-11-22Add documentation to `std::env::args[_os]`leo60228-0/+10
2019-09-06A few cosmetic improvements to code & comments in liballoc and libcoreAlexander Regueiro-1/+1
2019-08-11docs: add stdlib env::var(_os) panicTom Milligan-0/+12
2019-07-22add support for hexagon-unknown-linux-muslBrian Cain-0/+5
2019-05-23Fix typo "spit_paths", add linkBrent Kerby-1/+3
2019-05-22Revert "Add implementations of last in terms of next_back on a bunch of ↵Steven Fackler-6/+0
DoubleEndedIterators." This reverts commit 3e86cf36b5114f201868bf459934fe346a76a2d4.
2019-05-15Auto merge of #60775 - hellow554:no_bitrig, r=joshtriplettbors-1/+0
Remove bitrig support from rust Resolves #60743 using `find` and `rg` I delete every occurence of "bitrig" in the sources, expect for the llvm submodule (is this correct?). There's also this file https://github.com/rust-lang/rls/blob/5b8e99bb61958ca8abcb7c5eda70521726be1065/rls-analysis/test_data/rust-analysis/libstd-af9bacceee784405.json which contains a bitrig string in it. What to do with that?
2019-05-14Rollup merge of #60130 - khuey:efficient_last, r=sfacklerMazdak Farrokhzad-0/+6
Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators Provided a `DoubleEndedIterator` has finite length, `Iterator::last` is equivalent to `DoubleEndedIterator::next_back`. But searching forwards through the iterator when it's unnecessary is obviously not good for performance. I ran into this on one of the collection iterators. I tried adding appropriate overloads for a bunch of the iterator adapters like filter, map, etc, but I ran into a lot of type inference failures after doing so. The other interesting case is what to do with `Repeat`. Do we consider it part of the contract that `Iterator::last` will loop forever on it? The docs do say that the iterator will be evaluated until it returns None. This is also relevant for the adapters, it's trivially easy to observe whether a `Map` adapter invoked its closure a zillion times or just once for the last element.
2019-05-13Remove bitrig support from rustMarcel Hellwig-1/+0
2019-04-19Add implementations of last in terms of next_back on a bunch of ↵Kyle Huey-0/+6
DoubleEndedIterators. r?Manishearth
2019-04-17Document `Item` type in `std::env::SplitPaths` iterator.Nathan Kleyn-1/+7
Previously there wasn't any documentation to show what the type of `Item` was inside `std::env::SplitPaths`. Now, in the same format as other examples of docs in `srd` for `Iterator#Item`, we mention the type. This fixes #59543.
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-8/+8
2019-03-25SGX target: fix std unit testsJethro Beekman-1/+2
2019-02-28libstd => 2018Taiki Endo-13/+13
2019-02-17Use more impl header lifetime elisionScott McMurray-1/+1
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-04cleanup: remove static lifetimes from consts in libstdljedrz-21/+21
2018-07-12make reference to dirs crate clickable in terminalsRalf Jung-1/+1
2018-07-07Deprecate `std::env::home_dir` and fix incorrect documentationSimon Ochsenreither-10/+15
2018-05-14env: remove unwrap in examples in favor of try opJohn-John Tedro-12/+21
2018-04-05Correct a few stability attributesOliver Middleton-4/+4
2018-03-28Remove hidden `foo` functions from doc examples; use `Termination` trait.Corey Farwell-7/+7
Fixes https://github.com/rust-lang/rust/issues/49233.
2018-02-05Unimplement Send/Sync for ::env::{Args,ArgsOs,Vars,VarsOs}panicbit-0/+12
2018-01-11Make tests build on CloudABI.Ed Schouten-2/+9
There are some tests that need to be disabled on CloudABI specifically, due to the fact that the shims cannot be built in combination with unix::ext or windows::ext. Also improve the scoping of some imports to suppress compiler warnings.
2017-12-24Minor rewrite of env::current_exe docs; clarify symlinks.Corey Farwell-8/+11
- Update example in ‘security’ section to use hard links, like the linked securityvulns.com example. - Weaken language on symbolic links – indicate behavior is platform-specific Fixes https://github.com/rust-lang/rust/issues/43617.
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.