84904 Commits

Author SHA1 Message Date
Havvy (Ryan Scheel)
1a867dc346 cfg_attr_multi: Basic implementation
Does not implement the warning or a feature flag.
2018-10-05 17:29:17 -07:00
mandeep
82444aa753 Add doc comments about safest way to initialize a vector of zeros 2018-10-05 18:22:19 -04:00
Pietro Albini
51334c96b3
Rollup merge of #54853 - 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-05 22:33:22 +02:00
Pietro Albini
402c69950b
Rollup merge of #54851 - alexcrichton:revert-optimize, r=sfackler
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-05 22:33:21 +02:00
Pietro Albini
42fcde8abb
Rollup merge of #54838 - 11Takanori:fix-typo, r=petrochenkov
Fix typo in src/libsyntax/parse/parser.rs

contast -> contrast
2018-10-05 22:33:19 +02:00
Pietro Albini
f1b42c5ca7
Rollup merge of #54834 - kzys:fix-small-screen, r=GuillaumeGomez
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-05 22:33:18 +02:00
Pietro Albini
a95a6e287a
Rollup merge of #54833 - abonander:issue-54441, r=petrochenkov
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-05 22:33:17 +02:00
Pietro Albini
08af25fb27
Rollup merge of #54812 - pnkfelix:issue-32382-index-assoc-type-with-lifetime, r=nikomatsakis
Regression test for #32382.
2018-10-05 22:33:16 +02:00
Pietro Albini
ee745d6abf
Rollup merge of #54804 - euclio:inverted-parameters, r=estebank
add suggestion for inverted function parameters

Fixes #54065.
2018-10-05 22:33:15 +02:00
Pietro Albini
3810657ae3
Rollup merge of #54787 - varkor:unused-mut-in-desugaring, r=nikomatsakis
Only warn about unused `mut` in user-written code

Fixes https://github.com/rust-lang/rust/issues/54586.

r? @pnkfelix
cc @blitzerr
2018-10-05 22:33:13 +02:00
Pietro Albini
9e8f522e80
Rollup merge of #54781 - phansch:master, r=varkor
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-05 22:33:12 +02:00
Pietro Albini
5efac03f34
Rollup merge of #54717 - ljedrz:cleanup_ty_p1, r=davidtwco
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-05 22:33:11 +02:00
Pietro Albini
6b24de1edd
Rollup merge of #54078 - GabrielMajeri:expand-sync-docs, r=steveklabnik
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-05 22:33:10 +02:00
bors
fddcd316af Auto merge of #54743 - ljedrz:cleanup_ty_p2, r=zackmdavis
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-05 19:32:14 +00:00
David Wood
c07b712d2c
Simplify test.
Removes unnecessary type mismatch error from test that was hiding
borrow check error from NLL stderr.
2018-10-05 18:35:23 +02:00
Alex Crichton
70ae43fee7 Revert "Slightly refactor VecDeque implementation"
This reverts commit 6ce76acae455a32113116cd2f95f8076388fc2d3.
2018-10-05 09:15:57 -07:00
Alex Crichton
90b9469121 Revert "Optimize VecDeque::append"
This reverts commit 11e488b64fed181820280d494d4fcc157ee1adc5.
2018-10-05 09:15:52 -07:00
Alex Crichton
9a41cfabba Revert "Add docs and debug asserts"
This reverts commit 1a1a7f6167edf18b8a0ab488e651f7748cc2e9d3.
2018-10-05 09:15:48 -07:00
Alex Crichton
54441484d1 Revert "Fix tidy"
This reverts commit 1908892d3f60008f265dfc25ac46db387c0ad6a0.
2018-10-05 09:15:44 -07:00
Alex Crichton
8d81c03b65 Revert "Add another assert"
This reverts commit 21d2a6c9868541ec9829ced9a5bae936b18741c5.
2018-10-05 09:15:39 -07:00
Kazuyoshi Kato
23af6bb4e3 dro -> duckduckgo
dro means "doc.rust-lang.org", but it is too cryptic.
2018-10-05 08:52:44 -07:00
bors
2155f27b64 Auto merge of #54741 - oli-obk:impl_trait_hierarchy, r=cramertj
Nest the `impl Trait` existential item inside the return type

fixes #54045

r? @cramertj
2018-10-05 15:32:19 +00:00
Andy Russell
f5db411410
add suggestion for inverted function parameters
Fixes #54065.
2018-10-05 10:33:19 -04:00
bors
60c846046e Auto merge of #54336 - petrochenkov:preuni, r=alexcrichton
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-05 12:52:53 +00:00
ljedrz
c30ce35705 Remove graphviz::IntoCow 2018-10-05 14:16:10 +02:00
Oliver Scherer
fb04e26447 Stabilize min_const_fn feature gate 2018-10-05 12:29:03 +02:00
Oliver Scherer
ccbe7877a0 Remove old unused error code 2018-10-05 12:28:46 +02:00
Felix S. Klock II
704877f2ad Add doc comment explaining what BlockTailInfo is. 2018-10-05 12:26:29 +02:00
bors
766e21c7d7 Auto merge of #52121 - jebrosen:macros2_feature, r=petrochenkov
Merge `proc_macro_` expansion feature gates as `proc_macro_hygiene`

Merges `proc_macro_mod`, `proc_macro_expr`, `proc_macro_non_items`, and `proc_macro_gen` into a single feature: `proc_macro_hygiene`. These features are not all blocked on implementing macro hygiene *per se*, but rather on interactions with hygiene that have not been entirely resolved.
2018-10-05 10:08:01 +00:00
Felix S. Klock II
056cfffd1b Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
Felix S. Klock II
37f1003121 Updates to .stderr output in ui tests from earlier changes. 2018-10-05 12:04:53 +02:00
Felix S. Klock II
80bc17108e Improve diagnostics for borrow-check errors that result from drops of temporary r-values.
Changed `BorrowExplanation::UsedLaterWhenDropped` to handle both named
locals and also unnamed (aka temporaries).

If the dropped temporary does not implement `Drop`, then we print its
full type; but when the dropped temporary is itself an ADT `D` that
implements `Drop`, then diagnostic points the user directly at `D`.
2018-10-05 12:04:47 +02:00
Felix S. Klock II
504ab34e62 Replaced String with &str in API for add_explanation_to_diagnostic. 2018-10-05 12:00:01 +02:00
Austin Bonander
9da428dad8 make Parser::parse_foreign_item() return a foreign item or error
closes #54441
2018-10-05 02:47:57 -07:00
Takanori Ishibashi
819cbfeb96 contast -> contrast 2018-10-05 18:47:37 +09:00
Felix S. Klock II
9eebe77a86 Have add_explanation_to_diagnostic also take Mir as parameter.
This is preparation for allowing the `BorrowExplanation` carry things
like `mir::Location` or `mir::Local` and still be able to generate
usable diagnostic text.
2018-10-05 10:47:19 +02:00
Felix S. Klock II
8532c1896d Alpha-rename BorrowExplanation::emit to BorrowExplanation::add_explanation_to_diagnostic.
(I found it confusing to have calls to an `emit` method in our
error_reporting module where that `emit` method *wasn't* the
`DiagnosticBuffer::emit` method.)
2018-10-05 10:43:14 +02:00
Felix S. Klock II
74f8263032 Fix debug! to reflect rename of explain_why_borrow_contains_point. 2018-10-05 10:39:39 +02:00
Felix S. Klock II
a75afd82c9 Update doc for explain_why_borrow_contains_point to reflect its newer API. 2018-10-05 10:39:39 +02:00
Felix S. Klock II
4fff54381b Add flag to mir::LocalDecl to track whether its a temp from some subexpr a block tail expression.
Slightly refactored the `LocalDecl` construction API in the process.
2018-10-05 10:39:39 +02:00
Oliver Schneider
ec74d3533a Stabilize min_const_fn 2018-10-05 10:36:14 +02:00
Vadim Petrochenkov
0d8e9cd4df Reapply the macro_rules disambiguation changes from master 2018-10-05 11:46:12 +04:00
Vadim Petrochenkov
c29fb80c05 Reapply the derive helper changes from master 2018-10-05 11:40:52 +04:00
Vadim Petrochenkov
8994c6d417 expansion: Remove restriction on use of macro attributes with test/bench
The restrictions were introduced in https://github.com/rust-lang/rust/pull/54277 and no longer necessary now because legacy plugins are now expanded in usual left-to-right order
2018-10-05 11:40:40 +04:00
Vadim Petrochenkov
60a1d4e6c2 resolve: Keep more precise traces for expanded macro resolutions
`NameBinding`s instead of `Def`s
2018-10-05 11:40:40 +04:00
Vadim Petrochenkov
050bd32958 resolve: Merge resolution for macro_rules into the common early in-scope resolution function
`fn resolve_legacy_scope`/`fn resolve_lexical_macro_path_segment` -> `fn early_resolve_ident_in_lexical_scope`
2018-10-05 11:40:40 +04:00
bors
61f5ca7d64 Auto merge of #54703 - davidtwco:issue-52086, r=nikomatsakis
error message when trying to move from an Rc or Arc is ungreat

Fixes #52086.

r? @nikomatsakis
2018-10-05 07:40:36 +00:00
Vadim Petrochenkov
05a46815e4 resolve: Support value namespace in fn resolve_lexical_macro_path_segment 2018-10-05 11:40:19 +04:00
Vadim Petrochenkov
7b69088d15 expansion: Expand attribute macros registered by legacy plugins in usual left-to-right order 2018-10-05 11:40:19 +04:00
Vadim Petrochenkov
dd6347a6b9 resolve: Integrate inert attributes registererd by legacy plugins into macro resolution 2018-10-05 11:40:19 +04:00