summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* src/jemalloc is gone, remove its mention from COPYRIGHTSimonSapin-patch-1Simon Sapin2019-01-021-32/+0
|
* Auto merge of #57250 - codeworm96:tyerr_msg, r=varkorbors2019-01-0254-105/+105
|\ | | | | | | | | | | | | | | | | | | | | | | Improve type mismatch error messages Closes #56115. Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing. TODO the book and clippy needs to be changed accordingly later. r? @varkor
| * Improve type mismatch error messagesYuning Zhang2018-12-3154-105/+105
| | | | | | | | | | | | Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
* | Auto merge of #57251 - petrochenkov:reregr, r=varkorbors2019-01-023-2/+15
|\ \ | | | | | | | | | | | | | | | syntax: Fix regression in diagnostics for patterns in trait method parameters Fixes https://github.com/rust-lang/rust/issues/55036
| * | syntax: Fix regression in diagnostics for patterns in trait method parametersVadim Petrochenkov2019-01-013-2/+15
| | |
* | | Auto merge of #56827 - faern:eliminate-recv-timeout-panic, r=KodrAusbors2019-01-022-6/+30
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate Receiver::recv_timeout panic Fixes #54552. This panic is because `recv_timeout` uses `Instant::now() + timeout` internally. This possible panic is not mentioned in the documentation for this method. Very recently we merged (still unstable) support for checked addition (#56490) of `Instant + Duration`, so it's now finally possible to add these together without risking a panic.
| * | | Add documentation about panicking Add<Duration> implsLinus Färnstrand2018-12-141-0/+12
| | | |
| * | | Use checked_add for adding time in recv_timeoutLinus Färnstrand2018-12-141-6/+18
| | | |
* | | | Auto merge of #57209 - estebank:suggest-raw-ident, r=petrochenkovbors2019-01-0119-0/+92
|\ \ \ \ | | | | | | | | | | | | | | | Suggest using raw identifiers in 2018 edition when using keywords
| * | | | Update tests after rebaseEsteban Küber2018-12-311-0/+4
| | | | |
| * | | | Address review commentsEsteban Küber2018-12-3118-19/+68
| | | | | | | | | | | | | | | | | | | | | | | | | - Suggest raw ident escaping in all editions - Keep primary label in all cases
| * | | | Suggest using raw identifiers in 2018 edition when using keywordsEsteban Küber2018-12-316-8/+47
| | | | |
* | | | | Auto merge of #57125 - doitian:inconsistent-clone-doc, r=blussbors2019-01-011-9/+20
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix inconsistent Clone documentation. Now, arrays of any size Clone if the element type is Clone. So remove the the document that uses this as an example. refs #57123
| * | | | Fix inconsistent Clone documentation.ian2018-12-311-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use function pointer as the example to demonstrate how to implement Clone for Copy types. refs #57123
* | | | | Auto merge of #55937 - davidtwco:issue-54943, r=pnkfelixbors2019-01-0147-500/+804
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NLL: User type annotations refactor, associated constant patterns and ref bindings. Fixes #55511 and Fixes #55401. Contributes to #54943. This PR performs a large refactoring on user type annotations, checks user type annotations for associated constants in patterns and that user type annotations for `ref` bindings are respected. r? @nikomatsakis
| * | | | | Guarantee `rustc_dump_user_substs` error order.David Wood2018-12-302-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit buffers the errors output by the `rustc_dump_user_substs` attribute so that they can be output in order of span and would therefore be consistent.
| * | | | | Stop duplicating projections of type annotation.David Wood2018-12-305-114/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes how type annotations are handled in bindings during MIR building. Instead of building up a `PatternTypeProjections` with the `CanonicalUserTypeAnnotation` and projections, the `CanonicalUserTypeAnnotation` is stored in the `canonical_user_type_annotations` map at the start and the (equivalent) `UserTypeProjections` is built up with the new index and same projections. This has the effect of deduplicating type annotations as instead of type annotations being added to the `canonical_user_type_annotations` map multiple times at the end after being duplicated (which happens in building up `PatternTypeProjections`), it is instead added once.
| * | | | | Stop well-formedness checking unreachable code.David Wood2018-12-3013-245/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit stops well-formedness checking applying to unreachable code and therefore stops some of the ICEs that the intended solution taken by this PR causes. By disabling these checks, we can land the other fixes and larger refactors that this PR includes.
| * | | | | Fix unresolved inference variable ICE.David Wood2018-12-305-16/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit moves well-formedness check for the `UserTypeAnnotation::Ty(..)` case from always running to only when the code is reachable. This solves the ICE that resulted from `src/test/ui/issue-54943-1.rs` (a minimal repro of `dropck-eyepatch` run-pass tests that failed). The main well-formedness check that was intended to be run despite unreachable code still is, that being the `UserTypeAnnotation::TypeOf(..)` case. Before this PR, the other case wasn't being checked at all. It is possible to fix this ICE while still always checking well-formedness for the `UserTypeAnnotation::Ty(..)` case but that solution will ICE in unreachable code for that case, the diff for that change [can be found here](0). [0]: https://gist.github.com/davidtwco/f9751ffd9c0508f7251c0f17adc3af53
| * | | | | Add explicit error annotations to test.David Wood2018-12-303-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds explicit error annotations to tests after rebasing which is now required.
| * | | | | Support user type annotations in `ref` bindings.David Wood2018-12-307-20/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for user type annotations in variables declared using `ref` bindings. When a variable declared using a `ref` binding, then the `LocalDecl` has the type `&T` where the `&` was introduced by the `ref` binding but the canonicalized type annotation has only a `T` since the reference is implicit with the `ref` binding. Therefore, to support type annotations, the canonicalized type annotation either needs wrapped in a reference, or the `LocalDecl` type must have a wrapped reference removed for comparison. It is easier to remove the outer reference from the `LocalDecl` for the purpose of comparison, so that is the approach this commit takes.
| * | | | | Add user type annotations to MIR dump.David Wood2018-12-302-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit writes the user type annotations to the MIR dump so that they are visible again.
| * | | | | Type annotations in associated constant patterns.David Wood2018-12-307-13/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for respecting user type annotations with associated constants in patterns.
| * | | | | Add test for unreachable well-formedness.David Wood2018-12-302-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a test for checking that types are well-formed when unreachable.
| * | | | | Always check well-formedness.David Wood2018-12-3011-42/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit uses the map introduced by the previous commit to ensure that types are always checked for well-formedness by the NLL type check. Previously, without the map introduced by the previous commit, types would not be checked for well-formedness if the `AscribeUserType` statement that would trigger that check was removed as unreachable code.
| * | | | | Refactor `UserTypeAnnotation`.David Wood2018-12-3027-355/+476
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit refactors the `UserTypeAnnotation` type to be referred to by an index within `UserTypeProjection`. `UserTypeAnnotation` is instead kept in an `IndexVec` within the `Mir` struct. Further, instead of `UserTypeAnnotation` containing canonicalized types, it now contains normal types and the entire `UserTypeAnnotation` is canonicalized. To support this, the type was moved from the `rustc::mir` module to `rustc::ty` module.
* | | | | | Auto merge of #57203 - nagisa:readme, r=Mark-Simulacrumbors2019-01-011-8/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove mention of required memory to build Because it, obviously, changes all the time and 600MiB is way out-of-date now.
| * | | | | | Remove mention of required memory to buildSimonas Kazlauskas2018-12-301-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because it, obviously, changes all the time and 600MiB is way out-of-date now.
* | | | | | | Auto merge of #57210 - estebank:str-err, r=zackmdavisbors2019-01-016-11/+148
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Tweak unicode escape diagnostics
| * | | | | | | Do not use unicode character in diagnostic helpEsteban Küber2018-12-312-4/+4
| | | | | | | |
| * | | | | | | Use structured suggestion for braceless unicode escape squenceEsteban Küber2018-12-315-16/+47
| | | | | | | |
| * | | | | | | Account for `\xFF` and `\u{FF}` sequences in string format errorsEsteban Küber2018-12-313-1/+107
| | |_|_|/ / / | |/| | | | |
* | | | | | | Auto merge of #57194 - matthiaskrgr:copyright_headers, r=Centrilbors2019-01-0123-213/+13
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove more copyright headers r? @Mark-Simulacrum
| * | | | | | | update tests line numbersMatthias Krüger2018-12-292-13/+13
| | | | | | | |
| * | | | | | | remove remaining copyright headersMatthias Krüger2018-12-2821-200/+0
| | | | | | | |
* | | | | | | | Auto merge of #57199 - petrochenkov:ambig, r=estebankbors2019-01-018-54/+63
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resolve: Simplify treatment of ambiguity errors If we have a glob conflict like this ```rust mod m1 { struct S; } mod m2 { struct S; } use m1::*; use m2::*; ``` we treat it as a special "ambiguity item" that's not an error by itself, but produces an error when actually used. ```rust use m1::*; // primary use m2::*; // secondary => ambiguity S(m1::S, m2::S); ``` Ambiguity items were *sometimes* treated as their primary items for error recovery, but pretty irregularly. After this PR they are always treated as their primary items, except that - If an ambiguity item is marked as used, then it still produces an error. - Ambiguity items are still filtered away when exported to other crates (which is also a use in some sense).
| * | | | | | | | resolve: Simplify treatment of ambiguity errorsVadim Petrochenkov2018-12-299-75/+65
| | | | | | | | |
* | | | | | | | | Auto merge of #56878 - petrochenkov:privdyn, r=arielb1bors2018-12-3122-559/+621
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | privacy: Use common `DefId` visiting infrastructure for all privacy visitors One repeating pattern in privacy checking is going through a type, visiting all `DefId`s inside it and doing something with them. This is the case because visibilities and reachabilities are attached to `DefId`s. Previously various privacy visitors visited types slightly differently using their own methods, with most recently written `TypePrivacyVisitor` being the "gold standard". This mostly worked okay, but differences could manifest in overly conservative reachability analysis, some errors being reported twice, some private-in-public lints (not errors) being wrongly reported or not reported. This PR does something that I wanted to do since https://github.com/rust-lang/rust/pull/32674#discussion_r58291608 - factoring out the common visiting logic! Now all the common logic is contained in `struct DefIdVisitorSkeleton`, with specific privacy visitors deciding only what to do with visited `DefId`s (via `trait DefIdVisitor`). A bunch of cleanups is also applied in the process. This area is somewhat tricky due to lots of easily miss-able details, but thankfully it's was well covered by tests in https://github.com/rust-lang/rust/pull/46083 and previous PRs, so I'm relatively sure in the refactoring correctness. Fixes https://github.com/rust-lang/rust/pull/56837#discussion_r241962239 in particular. Also this will help with implementing https://github.com/rust-lang/rust/issues/48054.
| * | | | | | | | | Address review commentsVadim Petrochenkov2019-01-0110-96/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Say "trait" instead of "type" in diagnostics for `dyn Trait`
| * | | | | | | | | privacy: Use common `DefId` visiting infra for all privacy visitorsVadim Petrochenkov2019-01-0117-533/+565
| | |_|_|_|_|_|_|/ | |/| | | | | | |
* | | | | | | | | Auto merge of #57047 - euclio:field-structured-suggestions, r=estebankbors2018-12-3118-35/+50
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use structured suggestions for nonexistent fields r? @estebank
| * | | | | | | | use structured suggestions for nonexistent fieldsAndy Russell2018-12-3118-35/+50
| | | | | | | | |
* | | | | | | | | Auto merge of #57220 - quark-zju:mcount, r=estebankbors2018-12-313-1/+23
|\ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `-Z instrument-mcount` This flag inserts `mcount` function call to the beginning of every function after inline processing. So tracing tools like uftrace [1] (or ftrace for Linux kernel modules) have a chance to examine function calls. It is similar to the `-pg` flag provided by gcc or clang, but without generating a `__gmon_start__` function for executables. If a program runs without being traced, no `gmon.out` will be written to disk. Under the hood, it simply adds `"instrument-function-entry-inlined"="mcount"` attribute to every function. The `post-inline-ee-instrument` LLVM pass does the actual job. [1]: https://github.com/namhyung/uftrace
| * | | | | | | | Add `-Z instrument-mcount`Jun Wu2018-12-303-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This flag inserts `mcount` function call to the beginning of every function after inline processing. So tracing tools like uftrace [1] (or ftrace for Linux kernel modules) have a chance to examine function calls. It is similar to the `-pg` flag provided by gcc or clang, but without generating a `__gmon_start__` function for executables. If a program runs without being traced, no `gmon.out` will be written to disk. Under the hood, it simply adds `"instrument-function-entry-inlined"="mcount"` attribute to every function. The `post-inline-ee-instrument` LLVM pass does the actual job. [1]: https://github.com/namhyung/uftrace
* | | | | | | | | Auto merge of #57061 - Zoxc:graph-refactor, r=michaelwoeristerbors2018-12-313-187/+193
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Group dep node data into a single structure r? @michaelwoerister
| * | | | | | | | | Address commentsJohn Kåre Alsaker2018-12-312-12/+14
| | | | | | | | | |
| * | | | | | | | | Use `entry` API to avoid double lookup when interning dep nodesJohn Kåre Alsaker2018-12-311-30/+39
| | | | | | | | | |
| * | | | | | | | | Group dep node data into a single structureJohn Kåre Alsaker2018-12-313-170/+165
| | | | | | | | | |
* | | | | | | | | | Auto merge of #57208 - estebank:issue-57198, r=petrochenkovbors2018-12-315-2/+30
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not complain about missing crate named as a keyword Fix #57198.
| * | | | | | | | | Address review comments: Remove new `PathResult` variantEsteban Küber2018-12-303-15/+6
| | | | | | | | | |