- 23 1月, 2018 4 次提交
-
-
由 Michael Woerister 提交于
-
由 Michael Woerister 提交于
-
由 bors 提交于
[Incremental] Cache hashes for AdDef and ty::Slice<T> r? @michaelwoerister
-
由 bors 提交于
rustc: Lower link args to `@`-files on Windows more When spawning a linker rustc has historically been known to blow OS limits for the command line being too large, notably on Windows. This is especially true of incremental compilation where there can be dozens of object files per compilation. The compiler currently has logic for detecting a failure to spawn and instead passing arguments via a file instead, but this failure detection only triggers if a process actually fails to spawn. Unfortunately on Windows we've got something else to worry about which is `cmd.exe`. The compiler may be running a linker through `cmd.exe` where `cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`. Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently detect. Consequently this commit updates the logic for the spawning the linker on Windows to instead have a heuristic to see if we need to pass arguments via a file. This heuristic is an overly pessimistic and "inaccurate" calculation which just calls `len` on a bunch of `OsString` instances (where `len` is not precisely the length in u16 elements). This number, when exceeding the 6k threshold, will force rustc to always pass arguments through a file. This strategy should avoid us trying to parse the output on Windows of the linker to see if it successfully spawned yet failed to actually sub-spawn the linker. We may just be passing arguments through files a little more commonly now... The motivation for this commit was a recent bug in Gecko [1] when beta testing, notably when incremental compilation was enabled it blew out the limit on `cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a bat script as well (and we're blowing the limit there). [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886 Closes #46999
-
- 22 1月, 2018 15 次提交
-
-
由 bors 提交于
renumber regions in generators This fixes #47189, but I think we still have to double check various things around how to treat generators in MIR type check + borrow check (e.g., what borrows should be invalidated by a `Suspend`? What consistency properties should type check be enforcing anyway around the "interior" type?) Also fixes #47587 thanks to @spastorino's commit. r? @pnkfelix
-
由 bors 提交于
Custom error when moving arg outside of its closure When given the following code: ```rust fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) { f(&()); } fn main() { let mut x = None; give_any(|y| x = Some(y)); } ``` provide a custom error: ``` error: borrowed data cannot be moved outside of its closure --> file.rs:7:27 | 6 | let mut x = None; | ----- borrowed data cannot be moved into here... 7 | give_any(|y| x = Some(y)); | --- ^ cannot be moved outside of its closure | | | ...because it cannot outlive this closure ``` instead of the generic lifetime error: ``` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> file.rs:7:27 | 7 | give_any(|y| x = Some(y)); | ^ | note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 7:14... --> file.rs:7:14 | 7 | give_any(|y| x = Some(y)); | ^^^^^^^^^^^^^^^ note: ...so that expression is assignable (expected &(), found &()) --> file.rs:7:27 | 7 | give_any(|y| x = Some(y)); | ^ note: but, the lifetime must be valid for the block suffix following statement 0 at 6:5... --> file.rs:6:5 | 6 | / let mut x = None; 7 | | give_any(|y| x = Some(y)); 8 | | } | |_^ note: ...so that variable is valid at time of its declaration --> file.rs:6:9 | 6 | let mut x = None; | ^^^^^ ``` Fix #45983.
-
由 Alex Crichton 提交于
When spawning a linker rustc has historically been known to blow OS limits for the command line being too large, notably on Windows. This is especially true of incremental compilation where there can be dozens of object files per compilation. The compiler currently has logic for detecting a failure to spawn and instead passing arguments via a file instead, but this failure detection only triggers if a process actually fails to spawn. Unfortunately on Windows we've got something else to worry about which is `cmd.exe`. The compiler may be running a linker through `cmd.exe` where `cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`. Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently detect. Consequently this commit updates the logic for the spawning the linker on Windows to instead have a heuristic to see if we need to pass arguments via a file. This heuristic is an overly pessimistic and "inaccurate" calculation which just calls `len` on a bunch of `OsString` instances (where `len` is not precisely the length in u16 elements). This number, when exceeding the 6k threshold, will force rustc to always pass arguments through a file. This strategy should avoid us trying to parse the output on Windows of the linker to see if it successfully spawned yet failed to actually sub-spawn the linker. We may just be passing arguments through files a little more commonly now... The motivation for this commit was a recent bug in Gecko [1] when beta testing, notably when incremental compilation was enabled it blew out the limit on `cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a bat script as well (and we're blowing the limit there). [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886 Closes #46999
-
由 bors 提交于
Rollup of 9 pull requests - Successful merges: #47247, #47334, #47512, #47582, #47595, #47625, #47632, #47633, #47637 - Failed merges:
-
由 Guillaume Gomez 提交于
Fix mailmap duplicates, Carol and Brian. This fix corrects the .mailmap file so that Carol (Nichols || Goulding) appears only once, and Brian Anderson also appears only once.
-
由 Guillaume Gomez 提交于
Fix ICE with `use self;` Closes #47623
-
由 Guillaume Gomez 提交于
Fix broken links to other slice functions in chunks/chunks_mut/exact_… …chunk/exact_chunks_mut docs See https://github.com/rust-lang/rust/pull/47126#discussion_r162780492
-
由 Guillaume Gomez 提交于
fix doctests for BTreeSet to use BTreeSet (not BTreeMap) This fixes #47624
-
由 Guillaume Gomez 提交于
Small improvements to the documentation of VecDeque. Some small improvements to the documentation of `VecDeque`.
-
由 Guillaume Gomez 提交于
Automaticaly calculate beta prerelease numbers This is a forward-port of: * 9426dda8 * cbfb9858 from the beta branch which is used to automatically calculate the beta number based on the number of merges to the beta branch so far.
-
由 Guillaume Gomez 提交于
Add E0659 for ambiguous names Still on the tracks of the "no error without error code" road.
-
由 Guillaume Gomez 提交于
Only link res_init() on GNU/*nix To workaround a bug in glibc <= 2.26 lookup_host() calls res_init() based on the glibc version detected at runtime. While this avoids calling res_init() on platforms where it's not required we will still end up linking against the symbol. This causes an issue on macOS where res_init() is implemented in a separate library (libresolv.9.dylib) from the main libc. While this is harmless for standalone programs it becomes a problem if Rust code is statically linked against another program. If the linked program doesn't already specify -lresolv it will cause the link to fail. This is captured in issue #46797 Fix this by hooking in to the glibc workaround in `cvt_gai` and only activating it for the "gnu" environment on Unix This should include all glibc platforms while excluding musl, windows-gnu, macOS, FreeBSD, etc. This has the side benefit of removing the #[cfg] in sys_common; only unix.rs has code related to the workaround now. Before this commit: ```shell > cat main.rs use std::net::ToSocketAddrs; #[no_mangle] pub extern "C" fn resolve_test() -> () { let addr_list = ("google.com.au", 0).to_socket_addrs().unwrap(); println!("{:?}", addr_list); } > rustc --crate-type=staticlib main.rs > clang libmain.a test.c -o combined Undefined symbols for architecture x86_64: "_res_9_init", referenced from: std::net::lookup_host::h93c17fe9ad38464a in libmain.a(std-826c8d3b356e180c.std0.rcgu.o) ld: symbol(s) not found for architecture x86_64 clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation) ``` Afterwards: ```shell > rustc --crate-type=staticlib main.rs > clang libmain.a test.c -o combined > ./combined IntoIter([V4(172.217.25.131:0)]) ``` Fixes #46797
-
由 Guillaume Gomez 提交于
Suggest casting on numeric type error Re #47168.
-
由 bors 提交于
Tweaks to invalid ctor messages - Do not suggest using a constructor that isn't accessible - Suggest the appropriate syntax (`()`/`{}` as appropriate) - Add note when trying to use `Self` as a ctor CC #22488, fix #47085.
-
- 21 1月, 2018 21 次提交
-
-
由 Russell Mackenzie 提交于
-
由 Pieter Penninckx 提交于
-
由 bors 提交于
check_match: fix handling of privately uninhabited types the match-checking code used to use TyErr for signaling "unknown, inhabited" types for a long time. It had been switched to using the exact type in #38069, to handle uninhabited types. However, in #39980, we discovered that we still needed the "unknown inhabited" logic, but I used `()` instead of `TyErr` to handle that. Revert to using `TyErr` to fix that problem. Fixes #46964. r? @nikomatsakis
-
由 Pietro Albini 提交于
-
由 bors 提交于
Rollup of 10 pull requests - Successful merges: #46938, #47193, #47508, #47510, #47532, #47535, #47559, #47568, #47573, #47578 - Failed merges:
-
由 bors 提交于
remove bogus assertion and comments The code (incorrectly) assumed that constants could not have generics in scope, but it's not really a problem if they do. Fixes #47153 r? @pnkfelix
-
由 Andrew Straw 提交于
This fixes #47624
-
由 Guillaume Gomez 提交于
Update BTreeMap recommendation Focus on the ordering / range(instead of all) benefit as it's the most important feature.
-
由 Guillaume Gomez 提交于
Closure argument mismatch tweaks - use consistent phrasing for expected and found arguments - suggest changing arguments to tuple if possible - suggest changing single tuple argument to arguments if possible Fix #44150.
-
由 Guillaume Gomez 提交于
Give TargetOptions::linker a sane default value for CloudABI. Though some parts of rust use cc-rs to invoke a compiler/linker, Cargo seems to make use of the TargetOptions::linker property. Make the out of the box experience for CloudABI a bit better by using the same compiler name as cc-rs.
-
由 Guillaume Gomez 提交于
Fix the "Github - About Pull Requests" link in CONTRIBUTING.md Previously the text that is supposed to link to the Github Pull Requests page, instead linked to the same file (CONTRIBUTING.md).
-
由 Guillaume Gomez 提交于
add target/ to ignored tidy dirs Sometimes you get a target directory from running cargo in the rust repo (the root is `src/`), and it contains generated files. Just whitelist it since it causes tidy to spew warnings uncontrollably.
-
由 Guillaume Gomez 提交于
Add some edge cases to the documentation of `Path` Affected methods are `starts_with` and `strip_prefix`.
-
由 Guillaume Gomez 提交于
Deprecate std::net::lookup_host We intended to do this quite a while ago but it snuck through. r? @alexcrichton
-
由 Guillaume Gomez 提交于
add Rust By Example to the bookshelf cc #46194 With #46196 freshly merged, we should add a link to the main docs distribution so people can find it! We discussed this at the docs team meeting today and decided to go ahead with adding it to the bookshelf.
-
由 Guillaume Gomez 提交于
Add transpose conversions for nested Option and Result These impls are useful when working with combinator methods that expect an option or a result, but you have a `Result<Option<T>, E>` instead of an `Option<Result<T, E>>` or vice versa.
-
由 Guillaume Gomez 提交于
add kbd style tag to main.css in rustdoc Added css style for kbd tags so they actually look like keys. Result preview and discussion was going on in #46900 .
-
由 Esteban Küber 提交于
-
由 bjorn3 提交于
-