about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-01-21Rollup merge of #57769 - estebank:cast-suggestion-struct-field, r=matthewjasperMazdak Farrokhzad-12/+132
Suggest correct cast for struct fields with shorthand syntax ``` error[E0308]: mismatched types --> $DIR/type-mismatch-struct-field-shorthand.rs:8:19 | LL | let _ = RGB { r, g, b }; | ^ expected f64, found f32 help: you can cast an `f32` to `f64` in a lossless way | LL | let _ = RGB { r: r.into(), g, b }; | ^^^^^^^^^^^ ``` Fix #52497.
2019-01-21Rollup merge of #57768 - estebank:type-args-sugg, r=zackmdavisMazdak Farrokhzad-64/+118
Continue parsing after parent type args and suggest using angle brackets ``` error[E0214]: parenthesized parameters may only be used with a trait --> $DIR/E0214.rs:2:15 | LL | let v: Vec(&str) = vec!["foo"]; | ^^^^^^ | | | only traits may use parentheses | help: use angle brackets instead: `<&str>` ``` r? @zackmdavis
2019-01-21Rollup merge of #56796 - KrishnaSannasi:try_from_impl_change, r=shepmasterMazdak Farrokhzad-3/+40
Change bounds on `TryFrom` blanket impl to use `Into` instead of `From` This is from this [comment](https://github.com/rust-lang/rust/issues/33417#issuecomment-447111156) I made. This will expand the impls available for `TryFrom` and `TryInto`, without losing anything in the process.
2019-01-20Add regression test for #54582Esteban Küber-0/+16
2019-01-21Auto merge of #57789 - ehuss:update-cargo, r=Mark-Simulacrumbors-0/+0
Update cargo Pull in fix for #57774. 6 commits in ffe65875fd05018599ad07e7389e99050c7915be..907c0febe7045fa02dff2a35c5e36d3bd59ea50d 2019-01-17 23:57:50 +0000 to 2019-01-20 22:31:07 +0000 - Put mtime-on-use behind a feature flag. (rust-lang/cargo#6573) - Fix a typo in the unstable docs (rust-lang/cargo#6569) - Perhaps you meant: foo, bar or foobar (rust-lang/cargo#6550) - Refactor: Create uninstall submodule (rust-lang/cargo#6557) - Fix spurious Windows errors with switch_features_rerun. (rust-lang/cargo#6561) - Stop building on master on Travis. (rust-lang/cargo#6562) r? @Mark-Simulacrum
2019-01-20Update cargoEric Huss-0/+0
2019-01-20Tweak field parse error recoveryEsteban Küber-55/+20
2019-01-20Extend incorrect float literal recovery to account for suffixesEsteban Küber-20/+74
2019-01-20Reword message for incorrect float literalEsteban Küber-5/+5
2019-01-20Use is_dummy instead of comparing against DUMMY_SPEsteban Küber-2/+2
2019-01-20Auto merge of #57704 - lenoil98:patch-2, r=alexcrichtonbors-0/+3
Update bootstrap.py Add PowerPC64 support on FreeBSD
2019-01-20Remove unnecessary dummy span checksEsteban Küber-18/+24
The emitter already verifies wether a given span note or span label can be emitted to the output. If it can't, because it is a dummy span, it will be either elided for labels or emitted as an unspanned note/help when applicable.
2019-01-20Add "dereference boxed value" suggestion.David Wood-2/+183
This commit adds a `help: consider dereferencing the boxed value` suggestion to discriminants of match statements when the match arms have type `T` and the discriminant has type `Box<T>`.
2019-01-20Add default favicon for documentationGuillaume Gomez-3/+9
2019-01-21Fix testsYuki Okushi-3/+3
2019-01-21Add span for bad doc commentYuki Okushi-4/+8
2019-01-20Auto merge of #56884 - euclio:codeblock-diagnostics, r=QuietMisdreavusbors-131/+562
rustdoc: overhaul code block lexing errors Fixes #53919. This PR moves the reporting of code block lexing errors from rendering time to an early pass, so we can use the compiler's error reporting mechanisms. This dramatically improves the diagnostics in this situation: we now de-emphasize the lexing errors as a note under a warning that has a span and suggestion instead of just emitting errors at the top level. Additionally, this PR generalizes the markdown -> source span calculation function, which should allow other rustdoc warnings to use better spans in the future. Last, the PR makes sure that the code block is always emitted in the docs, even if it fails to highlight correctly. Of note: - The new pass unfortunately adds another pass over the docs to gather the doc blocks for syntax-checking. I wonder if this could be combined with the pass that looks for testable blocks? I'm not familiar with that code, so I don't know how feasible that is. - `pulldown_cmark` doesn't make it easy to find the spans of the code blocks, so the code that calculates the spans is a little nasty. It works for all the test cases I threw at it, but I wouldn't be surprised if an edge case would break it. Should have a thorough review. - This PR worsens the state of #56885, since those certain fatal lexing errors are now emitted before docs get generated at all.
2019-01-20const_eval: Predetermine the layout of all locals when pushing a stack frameBjörn Steinbrink-18/+24
Usually the layout of any locals is required at least three times, once when it becomes live, once when it is written to, and once it is read from. By adding a cache for them, we can reduce the number of layout queries speeding up code that is heavy on const_eval.
2019-01-20Add default rust logo for documentationGuillaume Gomez-1/+11
2019-01-20review commentEsteban Küber-1/+1
2019-01-20Auto merge of #57697 - dotdash:fast_lex_reg_resol_item_bodies, r=nagisabors-6/+8
Use a faster early exit during region expansion Turns out that the equality check for regions is rather expensive, and the current early exit check works in such a way, that the comparison is even done twice. As we only really care about the case of equal scopes, we can perform a faster, more specialized check and move it up one level, so we can eventually skip the additional full comparison as well.
2019-01-20cast the sign_extend result to i128.kenta7777-1/+1
2019-01-20reduce some code repetitionskenta7777-4/+6
2019-01-20Auto merge of #57680 - cuviper:codegen-rebuild, r=Mark-Simulacrumbors-0/+12
[rustbuild] Rebuild std after changes to codegen backends Use `clear_if_dirty` on std for backend changes, just as we do for changes to rustc itself, so new codegen is correctly applied to all later compiler stages. Fixes #48298.
2019-01-20Auto merge of #57655 - mtak-:fix-tls-dtors-macos, r=alexcrichtonbors-24/+45
OSX: fix #57534 registering thread dtors while running thread dtors r? @alexcrichton - "fast" `thread_local` destructors get run even on the main thread - "fast" `thread_local` dtors, can initialize other `thread_local`'s One corner case where this fix doesn't work, is when a C++ `thread_local` triggers the initialization of a rust `thread_local`. I did not add any std::thread specific flag to indicate that the thread is currently exiting, which would be checked before registering a new dtor (I didn't really know where to stick that). I think this does the trick tho! Let me know if anything needs tweaking/fixing/etc. resolves this for macos: https://github.com/rust-lang/rust/issues/28129 fixes: https://github.com/rust-lang/rust/issues/57534
2019-01-20Do not suggest angle brackets when there are no type argumentsEsteban Küber-48/+45
2019-01-20rustdoc: Don't modify library path for doctestsOliver Middleton-22/+5
It shouldn't be needed anymore because doctests are no longer compiled with `prefer-dynamic`.
2019-01-20Recover with suggestion from writing `.42` instead of `0.42`Esteban Küber-12/+47
2019-01-20Recover from parse errors in struct literal fieldsEsteban Küber-15/+132
Attempt to recover from parse errors while parsing a struct's literal fields by skipping tokens until a comma or the closing brace is found. This allows errors in other fields to be reported.
2019-01-20Auto merge of #57651 - JohnTitor:give-char-type, r=estebankbors-58/+165
Implement new literal type `Err` Fixes #57384 I removed `return Ok`, otherwise, two errors occur. Any solutions? r? @estebank
2019-01-20Remove whitespaceYuki Okushi-5/+4
2019-01-20Fix testsYuki Okushi-96/+56
2019-01-20Revert changeYuki Okushi-3/+2
2019-01-20Mark incorrect recovered `char` literals as `TyErr` to avoid type errorsYuki Okushi-4/+26
2019-01-19Suggest correct cast for struct fields with shorthand syntaxEsteban Küber-12/+132
2019-01-19Suggest usage of angle bracketsEsteban Küber-24/+48
2019-01-19Accept parenthesized type args for error recoveryEsteban Küber-25/+30
2019-01-19Continune parsing after encountering Trait with paren argsEsteban Küber-13/+41
2019-01-20linkchecker: Update deprecated trim_left_matches usageIgor Matuszewski-3/+3
2019-01-20Add missing #![feature(rustc_private)] annotationIgor Matuszewski-1/+2
2019-01-19Auto merge of #57761 - Centril:rollup, r=Centrilbors-369/+437
Rollup of 4 pull requests Successful merges: - #57452 (Improve docs for Formatter) - #57689 (Redo `hir::Stmt`) - #57723 (Point at cause for expectation in return type type error) - #57736 (Remove delay_span_bug from qualify_min_const_fn) Failed merges: r? @ghost
2019-01-20[WIP] Fix testsYuki Okushi-6/+91
2019-01-20[WIP] Improve error behaviorYuki Okushi-6/+8
2019-01-19Don't ignore `_` in type casts and ascriptionsMatthew Jasper-10/+89
2019-01-19Rollup merge of #57736 - phansch:remove_delay, r=oli-obkMazdak Farrokhzad-7/+1
Remove delay_span_bug from qualify_min_const_fn This is causing issues with a new Clippy lint that will be able to detect possible const functions. As per https://github.com/rust-lang/rust-clippy/pull/3648#discussion_r247927450 r? @oli-obk
2019-01-19Rollup merge of #57723 - estebank:fix, r=davidtwcoMazdak Farrokhzad-19/+201
Point at cause for expectation in return type type error Various improvements and fixes for type errors in return expressions. Fix #57664.
2019-01-19Rollup merge of #57689 - nnethercote:redo-hir-Stmt, r=petrochenkovMazdak Farrokhzad-340/+223
Redo `hir::Stmt` A couple of changes that make things simpler and more consistent. This should probably wait until after 1.32 lands to land, to avoid late breakage for tools.
2019-01-19Rollup merge of #57452 - steveklabnik:improve-formatter-docs, r=frewsxcvMazdak Farrokhzad-3/+12
Improve docs for Formatter Some improvements to `std::fmt::Formatter` to make it a bit more consistent with other documentation, as well as calling out that you don't ever instantiate one yourself.
2019-01-19Auto merge of #57721 - ehuss:update-cargo, r=alexcrichtonbors-0/+0
Update cargo Unblocks #56884 cc @euclio 6 commits in 2b4a5f1f0bb6e13759e88ea9512527b0beba154f..ffe65875fd05018599ad07e7389e99050c7915be 2019-01-12 04:13:12 +0000 to 2019-01-17 23:57:50 +0000 - Better error message for bad manifest with `cargo install`. (rust-lang/cargo#6560) - relax rustdoc output assertion (rust-lang/cargo#6559) - touch some files when we use them (rust-lang/cargo#6477) - Add documentation for new package/publish feature flags. (rust-lang/cargo#6553) - Update chat link to Discord. (rust-lang/cargo#6554) - Fix typo (rust-lang/cargo#6552) r? @alexcrichton
2019-01-19Type check unnanotated constant items with NLLMatthew Jasper-62/+128