about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-08-28Auto merge of #62941 - GuillaumeGomez:save-crate-filter, r=Mark-Simulacrumbors-3/+19
Save crate filtering on rustdoc Fixes #62929. I added a hashmap and a hash encoding for the current crate list in case you have multiple crates handling on a same website (who talked about docs.rs?!). Like that, for each context, you have the filter crate selected. r? @QuietMisdreavus
2019-08-28Auto merge of #63875 - philipc:issue-57822, r=michaelwoeristerbors-15/+80
debuginfo: give unique names to closure and generator types Closure types have been moved to the namespace where they are defined, and both closure and generator type names now include the disambiguator. This fixes an exception when lldb prints nested closures. Fixes #57822 I haven't included the `DW_AT_artificial` changes discussed in #57822 because they make the output worse IMO, but I can easily add these if still required. For example, for the new test case the output is now: ``` (lldb) p g (issue_57822::main::closure-1) $1 = closure-1(closure(1)) ``` but adding `DW_AT_artificial` changes this to: ``` (lldb) p g (issue_57822::main::closure-1) $0 = closure-1 { } ``` Note that nested generators didn't cause the exception. I haven't determined why, but I think it makes sense to add the disambiguator for them too. It feels like we still don't really understand why closures were causing an error though. r? @michaelwoerister
2019-08-28Auto merge of #63853 - matthewjasper:test-ast-serialization, r=estebankbors-4/+96
Add default serialization for `Ident`s Also add tests for `-Zast-json` and `-Zast-json-noexpand` closes #63728
2019-08-28Save crate filtering on rustdocGuillaume Gomez-3/+19
2019-08-28Auto merge of #63820 - oli-obk:eager_const_eval, r=nikomatsakisbors-81/+13
Simplify eager normalization of constants r? @nikomatsakis
2019-08-28Auto merge of #63127 - kper:pr, r=nikomatsakisbors-388/+391
Cleanup: Consistently use `Param` instead of `Arg` #62426 Fixes #62426
2019-08-27Auto merge of #63960 - ehuss:update-cargo, r=alexcrichtonbors-0/+0
Update cargo Update cargo 10 commits in 3f700ec43ce72305eb5315cfc710681f3469d4b4..22f7dd0495cd72ce2082d318d5a9b4dccb9c5b8c 2019-08-19 22:43:12 +0000 to 2019-08-27 16:10:51 +0000 - Update and improve zsh completion (rust-lang/cargo#7296) - Document that `package` can be used in `[patch]` (rust-lang/cargo#7263) - Fix `error:`/`warning:` coloring inconsistency with rustc (rust-lang/cargo#7294) - Tests: Import rustc_plugin from its new location (rust-lang/cargo#7287) - Update README azure badge. (rust-lang/cargo#7293) - Update home dependencies to v0.5 (rust-lang/cargo#7277) - Fix typo (rust-lang/cargo#7279) - Update libgit2 dependencies (rust-lang/cargo#7275) - Fix old lockfile encoding wrt newlines (rust-lang/cargo#7262) - Fix dSYM uplifting when symlink is broken (rust-lang/cargo#7268)
2019-08-27Add default serialization for `Ident`sMatthew Jasper-4/+96
Add tests for -Zast-json and -Zast-json-noexpand, which need this impl.
2019-08-27Update cargoEric Huss-0/+0
2019-08-27Auto merge of #63922 - RalfJung:miri, r=nikomatsakisbors-7/+9
update miri Cc @oli-obk Fixes https://github.com/rust-lang/rust/issues/63843
2019-08-27Changing error messages and renaming tests #63127Kevin Per-6/+6
`async-await/no-args-non-move-async-closure` `generator/no-arguments-on-generators`
2019-08-27update miriRalf Jung-7/+9
2019-08-27Auto merge of #63639 - Mark-Simulacrum:rustdoc-clean-3, r=GuillaumeGomezbors-507/+442
rustdoc: general cleanup
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-376/+379
2019-08-27Rollup merge of #63917 - lzutao:langitem_gen_63912, r=centril,cramertMazdak Farrokhzad-2/+25
Error when generator trait is not found Closes #63912
2019-08-27Rollup merge of #63761 - petrochenkov:procattrs, r=eddybMazdak Farrokhzad-172/+318
Propagate spans and attributes from proc macro definitions Thanks to https://github.com/rust-lang/rust/pull/63269 we now have spans and attributes from proc macro definitions available in metadata. However, that PR didn't actually put them into use! This PR finishes that work. Attributes `rustc_macro_transparency`, `allow_internal_unstable`, `allow_internal_unsafe`, `local_inner_macros`, `rustc_builtin_macro`, `stable`, `unstable`, `rustc_deprecated`, `deprecated` now have effect when applied to proc macro definition functions. From those attributes only `deprecated` is both stable and supposed to be used in new code. (`#![staged_api]` still cannot be used in proc macro crates for unrelated reasons though.) `Span::def_site` from the proc macro API now returns the correct location of the proc macro definition. Also, I made a mistake in https://github.com/rust-lang/rust/pull/63269#discussion_r312702919, loaded proc macros didn't actually use the resolver cache. This PR fixes the caching issue, now proc macros go through the `Resolver::macro_map` cache as well. (Also, the first commit turns `proc_macro::quote` into a regular built-in macro to reduce the number of places where `SyntaxExtension`s need to be manually created.)
2019-08-27Rollup merge of #63698 - Phosphorus15:master, r=nagisaMazdak Farrokhzad-19/+24
Fixed floating point issue with asinh function This should fixes #63271 , in which `asinh(-0.0)` returns `0.0` instead of `-0.0`. according to @nagisa > > > IEEE-754 (2008), section 9.2.1: > > > For the functions expm1, exp2m1, exp10m1, logp1, log2p1, log10p1, sin, tan, sinPi, atanPi, asin, atan, sinh, tanh, asinh, and atanh, f(+0) is +0 and f(−0) is −0 with no exception. > > and > > > sinh(±∞) and asinh(±∞) are ±∞ with no exception. After ensuring that the function `asinh` is the only function affected (functions like `sin`, `sinh` are all based on `cmath` library or `llvm` intrinsics), and that `atanh` always gives the correct result. The only function to modify is `asinh`.
2019-08-27Rollup merge of #62600 - emmericp:libtest-add-show-output, r=gnzlbgMazdak Farrokhzad-47/+101
libtest: add --show-output flag to print stdout of successful tests This pull request adds a new flag `--show-output` for tests to show the output of successful tests. For most formatters this was already supported just not exposed via the CLI (apparently only used by `librustdoc`). I've also added support for this option in the JSON formatter. This kind of fixes https://github.com/rust-lang/rust/issues/54669 which wants `--format json` to work with `--nocapture`, which is... well, impossible. What this issue really calls for is `--show-output` as implemented here.
2019-08-27debuginfo: always include disambiguator in type namesPhilip Craig-20/+18
2019-08-26Shorten line during rendering instead of in markdownMark Rousskov-44/+36
2019-08-26Inline recurse into only callsiteMark Rousskov-57/+40
2019-08-26Transition a few fmt::Display impls to functionsMark Rousskov-52/+56
This introduces a WithFormatter abstraction that permits one-time fmt::Display on an arbitrary closure, created via `display_fn`. This allows us to prevent allocation while still using functions instead of structs, which are a bit unwieldy to thread arguments through as they can't easily call each other (and are generally a bit opaque). The eventual goal here is likely to move us off of the formatting infrastructure entirely in favor of something more structured, but this is a good step to move us in that direction as it makes, for example, passing a context describing current state to the formatting impl much easier.
2019-08-26Inline RawMutableSpaceMark Rousskov-16/+7
2019-08-26Store only the current depthMark Rousskov-11/+11
Previously we stored the entire current path which is a bit expensive and only ever accessed its length. This stores the length directly.
2019-08-26Remove support for printing HRef in alternate modeMark Rousskov-11/+8
The alternate mode merely prints out the passed in text which is largely useless (as the text can simply be directly printed).
2019-08-26Remove dead tracking of external param namesMark Rousskov-45/+0
2019-08-26Mutate DocContext from LibEmbargoVisitor and RustdocVisitorMark Rousskov-27/+23
We have &mut access, so remove the RefCell borrowing
2019-08-26Move top-level Clean impl to functionMark Rousskov-87/+83
This allows us to pass it a `&mut DocContext` which will allow removal of RefCells, etc. in the following commits. It's also somewhat a unique Clean impl in that it previously ignored `self` (re-retriveing hir::Crate), which it no longer needs to do.
2019-08-26Move source HTML generation to own moduleMark Rousskov-173/+194
2019-08-27proc_macro: Update `Span::def_site` to use the proc macro definition locationVadim Petrochenkov-49/+151
Which is no longer dummy and is available from metadata now.
2019-08-27metadata: Eliminate `FullProcMacro`Vadim Petrochenkov-50/+28
Fix caching of loaded proc macros
2019-08-27Respect attributes on proc macro definitionsVadim Petrochenkov-67/+131
2019-08-26Rollup merge of #63921 - RalfJung:file-check, r=alexcrichtonMazdak Farrokhzad-0/+2
add link to FileCheck docs Thanks @gnzlbg for pointing me to those docs.
2019-08-26Rollup merge of #63855 - killercup:refactor/feature-gates, r=CentrilMazdak Farrokhzad-309/+419
Refactor feature gates After #63824, this goes a few steps further by - parsing doc comments in the macros to extract descriptions for feature gates, and - introducing a common `Feature` type to replace the tuples used previously to improve readability. The descriptions are not yet used, but I felt like this PR is a useful enough refactoring on its own. r? @Centril
2019-08-26Rollup merge of #63845 - DevQps:47091-remove-bad-example, r=nikomatsakisMazdak Farrokhzad-8/+0
Removed a confusing FnOnce example # Description See #47091 for a discussion. ## Changes - Removed an example that might suggest readers that square_x is (only) FnOnce. closes #47091
2019-08-26Rollup merge of #63836 - Wind-River:master_003, r=alexcrichtonMazdak Farrokhzad-1/+1
VxWorks does not provide a way to set the task name except at creation time Make set_name do thing as VxWorks does not provide a way to set the task name except at creation time. r? @alexcrichton cc @n-salim
2019-08-26Rollup merge of #63693 - Centril:polish-parse-or-pats, r=estebankMazdak Farrokhzad-226/+1081
Fully implement or-pattern parsing Builds upon the initial parsing in https://github.com/rust-lang/rust/pull/61708 to fully implement or-pattern (`p | q`) parsing as specified in [the grammar section of RFC 2535](https://github.com/rust-lang/rfcs/blob/master/text/2535-or-patterns.md#grammar). Noteworthy: - We allow or-patterns in `[p | q, ...]`. - We allow or-patterns in `let` statements and `for` expressions including with leading `|`. - We improve recovery for `p || q` (+ tests for that in `multiple-pattern-typo.rs`). - We improve recovery for `| p | q` in inner patterns (tests in `or-patterns-syntactic-fail.rs`). - We rigorously test or-pattern parsing (in `or-patterns-syntactic-{pass,fail}.rs`). - We harden the feature gating tests. - We do **_not_** change `ast.rs`. That is, `ExprKind::Let.0` and `Arm.pats` still accept `Vec<P<Pat>>`. I was starting work on that but it would be cleaner to do this in a separate PR so this one has a narrower scope. cc @dlrobertson cc the tracking issue https://github.com/rust-lang/rust/issues/54883. r? @estebank
2019-08-26Rollup merge of #63317 - estebank:dead-code, r=matthewjasperMazdak Farrokhzad-20/+172
Do not complain about unused code when used in `impl` `Self` type Fix https://github.com/rust-lang/rust/issues/18290.
2019-08-27proc_macro: Turn `quote` into a regular built-in macroVadim Petrochenkov-17/+19
Previously in was implemented using a special hack in the metadata loader
2019-08-26review commentEsteban Küber-2/+2
2019-08-26parser: fix span for leading vert.Mazdak Farrokhzad-5/+6
2019-08-26add link to FileCheck docsRalf Jung-0/+2
2019-08-26Error when generator trait is not foundLzu Tao-2/+25
2019-08-26Auto merge of #63901 - estebank:unknown-receiver-type, r=zackmdavisbors-12/+51
Point at method call on missing annotation error Make it clearer where the type name that couldn't be inferred comes from. Before: ``` error[E0282]: type annotations needed --> src/test/ui/span/type-annotations-needed-expr.rs:2:13 | 2 | let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `S` | = note: type must be known at this point ``` after ``` error[E0282]: type annotations needed --> src/test/ui/span/type-annotations-needed-expr.rs:2:39 | 2 | let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282 | ^^^ cannot infer type for `S` | = note: type must be known at this point ``` CC #63852.
2019-08-26Auto merge of #63897 - petrochenkov:prettycomma, r=estebankbors-15/+24
pprust: Do not print spaces before some tokens Fixes https://github.com/rust-lang/rust/issues/63896 r? @Mark-Simulacrum
2019-08-26Auto merge of #63580 - wesleywiser:move_promoted_out, r=oli-obkbors-369/+519
Move promoted MIR out of `mir::Body` r? @oli-obk
2019-08-26Auto merge of #62891 - vext01:improve-black-box-docs, r=RalfJung,Centril,gnzlbgbors-4/+12
Improve the documentation for std::hint::black_box. The other day a colleague was reviewing some of my code which was using `black_box` to block constant propogation. There was a little confusion because the documentation kind of implies that `black_box` is only useful for dead code elimination, and only in benchmarking scenarios. The docs currently say: > A function that is opaque to the optimizer, to allow benchmarks to pretend to use outputs to assist in avoiding dead-code elimination. Here is our discussion, in which I show (using godbolt) that a black box can also block constant propagation: https://github.com/softdevteam/yk/pull/21#discussion_r302985038 This change makes the docstring for `black_box` a little more general, and while we are here, I've added an example (the same one from our discussion). ![image](https://user-images.githubusercontent.com/604955/61701322-ddf1e400-ad35-11e9-878c-b5b44a20770c.png) OK to go in?
2019-08-26Auto merge of #62603 - cuviper:no-unwind-abort, r=joshtriplettbors-3/+11
Permit unwinding through FFI by default This repeats #62505 for master (Rust 1.38+), as #58794 is not yet resolved. This is a stopgap until a stable alternative is available, like [RFC 2699](https://github.com/rust-lang/rfcs/pull/2699), as long as progress is being made to that end. r? @joshtriplett
2019-08-25Point at method call on missing annotation errorEsteban Küber-12/+51
Make it clearer where the type name that couldn't be infered comes from.
2019-08-25Auto merge of #61613 - sinkuu:impl_trait_inline, r=ollie27bors-67/+264
Support `impl Trait` in inlined documentation `impl Trait` in argument position was not properly rendered when inlined from other crates. ([a live example on docs.rs](https://docs.rs/libp2p/0.8.1/libp2p/floodsub/struct.Floodsub.html#method.unsubscribe)) ![old](https://user-images.githubusercontent.com/7091080/59089838-14ba9900-8946-11e9-830b-53b317bdecb4.png) ↓ ![new](https://user-images.githubusercontent.com/7091080/59089844-16845c80-8946-11e9-9fe3-8998af9d73ce.png)