about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-10-08codegen_llvm: remove explicit returnsljedrz-3/+4
2018-10-08codegen_llvm: fix spelling & grammatical errorsljedrz-4/+4
2018-10-08codegen_llvm: improve common patternsljedrz-115/+86
2018-10-08codegen_llvm: improve allocationsljedrz-14/+26
2018-10-08codegen_llvm: whitespace & formatting improvementsljedrz-80/+69
2018-10-08Auto merge of #54700 - frewsxcv:frewsxcv-binary-search, r=GuillaumeGomezbors-10/+13
Clarify docs for when binary_search has many matches. Fixes https://github.com/rust-lang/rust/issues/51817.
2018-10-08Auto merge of #54609 - kzys:404-search, r=GuillaumeGomezbors-21/+54
Add the library search box on the 404 page It actually has a link to search already, but it would be better to have the search "box" as like index.md to be consistent. <style> can be shared with index.md, but these pages currently use https://doc.rust-lang.org/rust.css directly. Fixes #14572.
2018-10-07Auto merge of #53517 - phungleson:fix-impl-from-for-error, r=frewsxcvbors-0/+13
Add doc for impl From for Error As part of issue #51430 (cc @skade). The impl is very simple, let me know if we need to go into any details.
2018-10-07Auto merge of #54810 - 1aim:unused-impl-trait, r=oli-obkbors-7/+24
Fix dead code lint for functions using impl Trait Fixes https://github.com/rust-lang/rust/issues/54754 This is a minimal fix that doesn't add any new queries or touches unnecessary code. Please nominate for beta backport if wanted.
2018-10-07Auto merge of #54835 - ↵bors-254/+145
oli-obk:mögen_konstante_funktionen_doch_bitte_endlich_stabil_sein, r=Centril Stabilize `min_const_fn` tracking issue: #53555 r? @Centril
2018-10-07Clarify docs for when binary_search has many matches.Corey Farwell-10/+13
Fixes https://github.com/rust-lang/rust/issues/51817.
2018-10-07Auto merge of #54813 - petrochenkov:uilocale, r=alexcrichtonbors-42/+20
Fix two UI tests with locale-dependent output Closes https://github.com/rust-lang/rust/issues/54719
2018-10-07Auto merge of #54823 - euclio:needs-test, r=alexcrichtonbors-0/+68
Add tests for some E-needstest issues Fixes #28134. Fixes #24338. Fixes #29743.
2018-10-07Auto merge of #54451 - alexcrichton:no-mangle-extern-linkage, r=michaelwoeristerbors-307/+400
rustc: Allow `#[no_mangle]` anywhere in a crate This commit updates the compiler to allow the `#[no_mangle]` (and `#[export_name]` attributes) to be located anywhere within a crate. These attributes are unconditionally processed, causing the compiler to always generate an exported symbol with the appropriate name. After some discussion on #54135 it was found that not a great reason this hasn't been allowed already, and it seems to match the behavior that many expect! Previously the compiler would only export a `#[no_mangle]` symbol if it were *publicly reachable*, meaning that it itself is `pub` and it's otherwise publicly reachable from the root of the crate. This new definition is that `#[no_mangle]` *is always reachable*, no matter where it is in a crate or whether it has `pub` or not. This should make it much easier to declare an exported symbol with a known and unique name, even when it's an internal implementation detail of the crate itself. Note that these symbols will persist beyond LTO as well, always making their way to the linker. Along the way this commit removes the `private_no_mangle_functions` lint (also for statics) as there's no longer any need to lint these situations. Furthermore a good number of tests were updated now that symbol visibility has been changed. Closes #54135
2018-10-07Auto merge of #54782 - pnkfelix:issue-54556-semi-on-tail-diagnostic, ↵bors-141/+958
r=nikomatsakis NLL: temps in block tail expression diagnostic This change adds a diagnostic that explains when temporaries in a block tail expression live longer than block local variables that they borrow, and attempts to suggest turning the tail expresion into a statement (either by adding a semicolon at the end, when its result value is clearly unused, or by introducing a `let`-binding for the result value and then returning that). Fix #54556
2018-10-06rustc: Allow `#[no_mangle]` anywhere in a crateAlex Crichton-307/+400
This commit updates the compiler to allow the `#[no_mangle]` (and `#[export_name]` attributes) to be located anywhere within a crate. These attributes are unconditionally processed, causing the compiler to always generate an exported symbol with the appropriate name. After some discussion on #54135 it was found that not a great reason this hasn't been allowed already, and it seems to match the behavior that many expect! Previously the compiler would only export a `#[no_mangle]` symbol if it were *publicly reachable*, meaning that it itself is `pub` and it's otherwise publicly reachable from the root of the crate. This new definition is that `#[no_mangle]` *is always reachable*, no matter where it is in a crate or whether it has `pub` or not. This should make it much easier to declare an exported symbol with a known and unique name, even when it's an internal implementation detail of the crate itself. Note that these symbols will persist beyond LTO as well, always making their way to the linker. Along the way this commit removes the `private_no_mangle_functions` lint (also for statics) as there's no longer any need to lint these situations. Furthermore a good number of tests were updated now that symbol visibility has been changed. Closes #54135
2018-10-06Auto merge of #54756 - ljedrz:cleanup_middle, r=michaelwoeristerbors-711/+641
Cleanup rustc/middle - improve allocations - use `Cow<'static, str>` where applicable - improve some patterns - whitespace & formatting fixes
2018-10-06Auto merge of #54854 - matthiaskrgr:clippy_update, r=Manishearthbors-14/+14
submodules: update clippy to 22d37b53af5b to fix tests. Should fix clippy toolstate.
2018-10-06'a' → 'an' in front of vowel sounds.Corey Farwell-1/+1
2018-10-06Auto merge of #54766 - alexcrichton:wasm-all-symbols, r=michaelwoeristerbors-4/+89
wasm: Explicitly export all symbols with LLD This commit fixes an oddity on the wasm target where LTO can produce working executables but plain old optimizations doesn't. The compiler already knows what set of symbols it would like to export, but LLD only discovers this list transitively through symbol visibilities. LLD may not, however, always find all the symbols that we'd like to export. For example if you depend on an rlib with a `#[no_mangle]` symbol, then if you don't actually use anything from the rlib then the symbol won't appear in the final artifact! It will appear, however, with LTO. This commit attempts to rectify this situation by ensuring that all symbols rustc would otherwise preserve through LTO are also preserved through the linking process with LLD by default.
2018-10-06rustc/middle: whitespace & formatting fixesljedrz-572/+534
2018-10-06rustc/middle: improve allocationsljedrz-4/+8
2018-10-06rustc/middle: use Cow<'static, str> where applicableljedrz-38/+41
2018-10-06rustc/middle: improve some patternsljedrz-95/+56
2018-10-06submodules: update clippy to 32b1d1fc157f71ed2f10b60fe28abe087a743618 to fix ↵Matthias Krüger-14/+14
tests.
2018-10-06Auto merge of #54859 - pietroalbini:rollup, r=pietroalbinibors-503/+796
Rollup of 11 pull requests Successful merges: - #54078 (Expand the documentation for the `std::sync` module) - #54717 (Cleanup rustc/ty part 1) - #54781 (Add examples to `TyKind::FnDef` and `TyKind::FnPtr` docs) - #54787 (Only warn about unused `mut` in user-written code) - #54804 (add suggestion for inverted function parameters) - #54812 (Regression test for #32382.) - #54833 (make `Parser::parse_foreign_item()` return a foreign item or error) - #54834 (rustdoc: overflow:auto doesn't work nicely on small screens) - #54838 (Fix typo in src/libsyntax/parse/parser.rs) - #54851 (Fix a regression in 1.30 by reverting #53564) - #54853 (Remove unneccessary error from test, revealing NLL error.) Failed merges: r? @ghost
2018-10-05Rollup merge of #54853 - ↵Pietro Albini-28/+11
davidtwco:issue-52663-missing-lifetime-suggestion-test, r=nikomatsakis Remove unneccessary error from test, revealing NLL error. Part of #52663. Removes unnecessary type mismatch error from test that was hiding borrow check error from NLL stderr. r? @nikomatsakis
2018-10-05Rollup merge of #54851 - alexcrichton:revert-optimize, r=sfacklerPietro Albini-47/+5
Fix a regression in 1.30 by reverting #53564 Investigation on #54477 revealed https://github.com/rust-lang/rust/pull/53564 as the culprit in the regression for that crate. I've reproduced the regression with the [detailed test cases provided](https://github.com/rust-lang/rust/issues/54477#issuecomment-427398456). While we figure out how to fix the regression this commit reverts the current culprit.
2018-10-05Rollup merge of #54834 - kzys:fix-small-screen, r=GuillaumeGomezPietro Albini-1/+0
rustdoc: overflow:auto doesn't work nicely on small screens This property was introduced by 3f92ff34b5, but looks it doesn't overwrap even without the property. Fixes #54672.
2018-10-05Rollup merge of #54833 - abonander:issue-54441, r=petrochenkovPietro Albini-16/+40
make `Parser::parse_foreign_item()` return a foreign item or error Fixes `Parser::parse_foreign_item()` to follow the convention of `parse_trait_item()` and `parse_impl_item()` in that it *must* parse an item or return an error, and then the caller is responsible for detecting the closing delimiter. This prevents it from looping endlessly on an unexpected token in `ext/expand.rs` where it was also leaking memory by continually pushing to `Parser::expected_tokens` via `Parser::check_keyword()`. closes #54441 r? @petrochenkov cc @dtolnay
2018-10-05Rollup merge of #54812 - ↵Pietro Albini-0/+42
pnkfelix:issue-32382-index-assoc-type-with-lifetime, r=nikomatsakis Regression test for #32382.
2018-10-05Rollup merge of #54804 - euclio:inverted-parameters, r=estebankPietro Albini-1/+106
add suggestion for inverted function parameters Fixes #54065.
2018-10-05Rollup merge of #54787 - varkor:unused-mut-in-desugaring, r=nikomatsakisPietro Albini-17/+53
Only warn about unused `mut` in user-written code Fixes https://github.com/rust-lang/rust/issues/54586. r? @pnkfelix cc @blitzerr
2018-10-05Rollup merge of #54781 - phansch:master, r=varkorPietro Albini-1/+16
Add examples to `TyKind::FnDef` and `TyKind::FnPtr` docs This adds two examples to the docs of `TyKind::FnDef` and `TyKind::FnPtr`. I found these two types a bit confusing when I learned about them and I think adding these examples might help others.
2018-10-05Rollup merge of #54717 - ljedrz:cleanup_ty_p1, r=davidtwcoPietro Albini-388/+375
Cleanup rustc/ty part 1 Part 2 will follow soon; I wouldn't want these changes to rot too quickly. - improve stack shifting and remove related allocations - move a faster early return up - improve allocations - use Cow<str> where applicable - simplify common patterns - whitespace fixes
2018-10-05Rollup merge of #54078 - GabrielMajeri:expand-sync-docs, r=steveklabnikPietro Albini-4/+148
Expand the documentation for the `std::sync` module I've tried to expand the documentation for Rust's synchronization primitives. The module level documentation explains why synchronization is required when working with a multiprocessor system, and then links to the appropiate structure in this module. Fixes #29377, since this should be the last item on the checklist (documentation for `Atomic*` was fixed in #44854, but not ticked off the checklist).
2018-10-05Auto merge of #54743 - ljedrz:cleanup_ty_p2, r=zackmdavisbors-178/+146
Cleanup rustc/ty part 2 The second part of cleanups and minor improvements for rustc/ty. - improve allocations - calculate span after a possible early continue - simplify some patterns - mark a comment as FIXME - whitespace fixes The PR is independent from from the first part.
2018-10-05Simplify test.David Wood-28/+11
Removes unnecessary type mismatch error from test that was hiding borrow check error from NLL stderr.
2018-10-05Revert "Slightly refactor VecDeque implementation"Alex Crichton-3/+3
This reverts commit 6ce76acae455a32113116cd2f95f8076388fc2d3.
2018-10-05Revert "Optimize VecDeque::append"Alex Crichton-27/+2
This reverts commit 11e488b64fed181820280d494d4fcc157ee1adc5.
2018-10-05Revert "Add docs and debug asserts"Alex Crichton-23/+11
This reverts commit 1a1a7f6167edf18b8a0ab488e651f7748cc2e9d3.
2018-10-05Revert "Fix tidy"Alex Crichton-2/+1
This reverts commit 1908892d3f60008f265dfc25ac46db387c0ad6a0.
2018-10-05Revert "Add another assert"Alex Crichton-4/+0
This reverts commit 21d2a6c9868541ec9829ced9a5bae936b18741c5.
2018-10-05dro -> duckduckgoKazuyoshi Kato-2/+2
dro means "doc.rust-lang.org", but it is too cryptic.
2018-10-05Auto merge of #54741 - oli-obk:impl_trait_hierarchy, r=cramertjbors-181/+152
Nest the `impl Trait` existential item inside the return type fixes #54045 r? @cramertj
2018-10-05add suggestion for inverted function parametersAndy Russell-1/+106
Fixes #54065.
2018-10-05Auto merge of #54336 - petrochenkov:preuni, r=alexcrichtonbors-403/+262
resolve: Some refactorings in preparation for uniform paths 2.0 The main result is that in-scope resolution performed during macro expansion / import resolution is now consolidated in a single function (`fn early_resolve_ident_in_lexical_scope`), which can now be used for resolving first import segments as well when uniform paths are enabled. r? @ghost
2018-10-05Stabilize min_const_fn feature gateOliver Scherer-13/+2
2018-10-05Remove old unused error codeOliver Scherer-18/+0
2018-10-05Add doc comment explaining what `BlockTailInfo` is.Felix S. Klock II-0/+8