about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2020-12-20add an attribute to inner doctest fnArpad Borsos-6/+7
2020-12-19Remap instrument-coverage line numbers in doctestsArpad Borsos-56/+596
This uses the `SourceMap::doctest_offset_line` method to re-map line numbers from doctests. Remapping columns is not yet done. Part of issue #79417.
2020-12-19Auto merge of #79073 - davidtwco:issue-78957-const-param-attrs, r=lcnrbors-5/+147
passes: prohibit invalid attrs on generic params Fixes #78957. This PR modifies the `check_attr` pass so that attribute placement on generic parameters is checked for validity. r? `@lcnr`
2020-12-19Auto merge of #77035 - mibac138:fn-fat-arrow-return, r=davidtwcobors-25/+255
Gracefully handle mistyping -> as => in function return type Fixes #77019
2020-12-18Auto merge of #80154 - GuillaumeGomez:str-to-symbol, r=jyn514bors-8/+11
Continue String to Symbol conversion in rustdoc (2) Follow-up of #80119. This is the last one (and I actually expected more conversions but seems like it was the last one remaining...). r? `@jyn514`
2020-12-18Auto merge of #80081 - ehuss:update-cargo, r=Mark-Simulacrumbors-6/+100
Update cargo 4 commits in d274fcf862b89264fa2c6b917b15230705257317..a3c2627fbc2f5391c65ba45ab53b81bf71fa323c 2020-12-07 23:08:44 +0000 to 2020-12-14 17:21:26 +0000 - Check if rerun-if-changed points to a directory. (rust-lang/cargo#8973) - Implement external credential process. (RFC 2730) (rust-lang/cargo#8934) - Revert recent build-std vendoring changes (rust-lang/cargo#8968) - Fix the unit dependency graph with dev-dependency `links` (rust-lang/cargo#8969)
2020-12-18Auto merge of #80156 - RalfJung:rollup-m3poz8z, r=RalfJungbors-21/+42
Rollup of 6 pull requests Successful merges: - #80121 (Change the message for `if_let_guard` feature gate) - #80130 (docs: Edit rustc_span::symbol::Symbol method) - #80135 (Don't allow `const` to begin a nonterminal) - #80145 (Fix typo in rustc_typeck docs) - #80146 (Edit formatting in Rust Prelude docs) - #80147 (Add missing punctuation to std::alloc docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-12-18Update cargoEric Huss-6/+100
2020-12-18Rollup merge of #80147 - pierwill:patch-9, r=lcnrRalf Jung-1/+1
Add missing punctuation to std::alloc docs Add a period to first line of module docs to match other modules in std.
2020-12-18Rollup merge of #80146 - pierwill:pierwill-prelude-mod-docs, r=lcnrRalf Jung-13/+12
Edit formatting in Rust Prelude docs Use consistent punctuation and capitalization in the list of things re-exported in the prelude. Also adds a (possibly missing) word.
2020-12-18Rollup merge of #80145 - pierwill:patch-8, r=lcnrRalf Jung-1/+1
Fix typo in rustc_typeck docs
2020-12-18Rollup merge of #80135 - camelid:const-macro-nt, r=petrochenkovRalf Jung-0/+22
Don't allow `const` to begin a nonterminal Fixes #79908. Thanks to Vadim Petrochenkov who [told me what the fix was][z]! [z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422 r? ``@petrochenkov``
2020-12-18Rollup merge of #80130 - pierwill:patch-7, r=oli-obkRalf Jung-1/+1
docs: Edit rustc_span::symbol::Symbol method Edit wording of the doc comment for [rustc_span::symbol::Symbol::can_be_raw](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/symbol/struct.Symbol.html#method.can_be_raw) to match related methods.
2020-12-18Rollup merge of #80121 - LeSeulArtichaut:if-let-experimental, r=davidtwcoRalf Jung-5/+5
Change the message for `if_let_guard` feature gate `if-let` guards are now implemented by #79051 🎉 Thanks ``@camelid`` for pointing this out 🙂
2020-12-18Auto merge of #79485 - EllenNyan:stabilize_unsafe_cell_get_mut, r=m-ou-sebors-5/+2
Stabilize `unsafe_cell_get_mut` Tracking issue: #76943 r? `@m-ou-se`
2020-12-18Continue String to Symbol conversion in rustdocGuillaume Gomez-8/+11
2020-12-18Auto merge of #80090 - jyn514:tcx-in-render, r=GuillaumeGomezbors-179/+226
Pass a `TyCtxt` through to `FormatRender` This is the next step after https://github.com/rust-lang/rust/pull/79957 for https://github.com/rust-lang/rust/issues/76382. Eventually I plan to use this to remove `stability`, `const_stability`, and `deprecation` from `Item`, but that needs more extensive changes (in particular, https://github.com/rust-lang/rust/pull/75355 or something like it). This has no actual changes to behavior, it's just moving types around. ccc https://github.com/rust-lang/rust/pull/80014#issuecomment-746810284
2020-12-18Auto merge of #80119 - GuillaumeGomez:str-to-symbol, r=jyn514bors-69/+74
Continue String to Symbol conversion in rustdoc Follow-up of https://github.com/rust-lang/rust/pull/80091. This PR is already big enough so I'll stop here before the next one. r? `@jyn514`
2020-12-17Add missing punctuation to std::alloc docspierwill-1/+1
Add a period to first line of module docs to match other modules in std.
2020-12-17Edit formatting in Rust Prelude docspierwill-13/+12
Use consistent punctuation and capitalization in the list of things re-exported in the prelude. Also adds a (possibly missing) word.
2020-12-17Fix typo in rustc_typeck docspierwill-1/+1
2020-12-18Auto merge of #80036 - sivadeilra:syms_no_macro, r=petrochenkovbors-29/+24
Stop using intermediate macros in definition of symbols Currently, the rustc_macros::symbols macro generates two `macro_rules!` macros as its output. These two macros are used in rustc_span/src/symbol.rs. This means that each Symbol that we define is represented in the AST of rustc_symbols twice: once in the definition of the `define_symbols!` macro (similarly for the `keywords! macro), and once in the rustc_span::symbols definition. That would be OK if there were only a handful of symbols, but currently we define over 1100 symbols. The definition of the `define_symbols!` macro contains the expanded definition of each symbol, so that's a lot of AST storage wasted on a macro that is used exactly once. This commit removes the `define_symbols` macro, and simply allows the proc macro to directly generate the `rustc_symbols::symbol::sym` module. The benefit is mainly in reducing memory wasted during compilation of rustc itself. It should also reduce memory used by Rust Analyzer. This commit also reduces the size of the AST for symbol definitions, by moving two `#[allow(...)]` attributes from the symbol constants to the `sym` module. This eliminates 2200+ attribute nodes. This commit also eliminates the need for the `digits_array` constant. There's no need to store an array of Symbol values for digits. We can simply define a constant of the base value, and add to that base value. I left the `sym::integer` function in rustc_span/src/symbol.rs instead of moving it into rustc_macros/src/symbols.rs for two reasons. First, because it's human-written code; it doesn't need to be generated by the proc-macro. Second, because I didn't want the `#[allow(...)]` attributes that I moved to the `sym` module scope to apply to this function. The `sym` module re-exports the `integer` function from its parent module.
2020-12-18Auto merge of #80138 - Dylan-DPC:rollup-qamsfyh, r=Dylan-DPCbors-3596/+311
Rollup of 5 pull requests Successful merges: - #78164 (Prefer regions with an `external_name` in `approx_universal_upper_bound`) - #80003 (Fix overflow when converting ZST Vec to VecDeque) - #80023 (Enhance error message when misspelled label to value in break expression) - #80046 (Add more documentation to `Diagnostic` and `DiagnosticBuilder`) - #80109 (Remove redundant and unreliable coverage test results) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-12-18Rollup merge of #80109 - richkadel:llvm-coverage-counters-2.3.0, r=tmandryDylan DPC-3576/+86
Remove redundant and unreliable coverage test results The `coverage-reports` tests still generate counters and JSON reports for inspection, but these files are no longer used in Makefile diffs, to reduce complexity and confusion from unreliable or unexpected test results, especially when maintaining them (i.e., generating `--bless`ed results). The associated `expected_` files for counters and JSON reports have been removed, leaving only the files actually used for testing: the `llvm-cov show` reports. r? `@tmandry` Tyler - as we discussed offline... FYI: `@wesleywiser` `@Swatinem` Arpad, depending on the timing of this PR, it may not affect you, but I'm removing some of the files that produce slightly different results on Windows as they really aren't necessary to validate coverage results.
2020-12-18Rollup merge of #80046 - camelid:diag-docs, r=lcnrDylan DPC-14/+53
Add more documentation to `Diagnostic` and `DiagnosticBuilder` cc `@estebank`
2020-12-18Rollup merge of #80023 - ↵Dylan DPC-2/+113
sasurau4:feature/enhance-error-message-when-wrongly-written-broken-label, r=lcnr Enhance error message when misspelled label to value in break expression Fix #79424
2020-12-18Rollup merge of #80003 - Stupremee:fix-zst-vecdeque-conversion-panic, r=dtolnayDylan DPC-2/+13
Fix overflow when converting ZST Vec to VecDeque ```rust let v = vec![(); 100]; let queue = VecDeque::from(v); println!("{:?}", queue); ``` This code will currently panic with a capacity overflow. This PR resolves this issue and makes the code run fine. Resolves #78532
2020-12-18Rollup merge of #78164 - Aaron1011:fix/async-region-name, r=tmandryDylan DPC-2/+46
Prefer regions with an `external_name` in `approx_universal_upper_bound` Fixes #75785 When displaying a MIR borrowcheck error, we may need to find an upper bound for a region, which gives us a region to point to in the error message. However, a region might outlive multiple distinct universal regions, in which case the only upper bound is 'static To try to display a meaningful error message, we compute an 'approximate' upper bound by picking one of the universal regions. Currently, we pick the region with the lowest index - however, this caused us to produce a suboptimal error message in issue #75785 This PR `approx_universal_upper_bound` to prefer regions with an `external_name`. This causes us to prefer regions from function arguments/upvars, which seems to lead to a nicer error message in some cases.
2020-12-17Stop using intermediate macros in definition of symbolsArlie Davis-29/+24
Currently, the rustc_macros::symbols macro generates two `macro_rules!` macros as its output. These two macros are used in rustc_span/src/symbol.rs. This means that each Symbol that we define is represented in the AST of rustc_symbols twice: once in the definition of the `define_symbols!` macro (similarly for the `keywords! macro), and once in the rustc_span::symbols definition. That would be OK if there were only a handful of symbols, but currently we define over 1100 symbols. The definition of the `define_symbols!` macro contains the expanded definition of each symbol, so that's a lot of AST storage wasted on a macro that is used exactly once. This commit removes the `define_symbols` macro, and simply allows the proc macro to directly generate the `rustc_symbols::symbol::sym` module. The benefit is mainly in reducing memory wasted during compilation of rustc itself. It should also reduce memory used by Rust Analyzer. This commit also reduces the size of the AST for symbol definitions, by moving two `#[allow(...)]` attributes from the symbol constants to the `sym` module. This eliminates 2200+ attribute nodes. This commit also eliminates the need for the `digits_array` constant. There's no need to store an array of Symbol values for digits. We can simply define a constant of the base value, and add to that base value.
2020-12-17Don't allow `const` to begin a nonterminalCamelid-0/+22
Thanks to Vadim Petrochenkov who [told me what the fix was][z]! [z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422
2020-12-17Auto merge of #80122 - davidtwco:revert-76030, r=oli-obkbors-10/+3
Revert "cg_llvm: `fewer_names` in `uncached_llvm_type`" Fixes #76213 and fixes #79564. This PR temporarily reverts commit fa01ce802f1b403a2140fd945b43af86ec3998a1 from #76030 to until the root issue can be resolved. Requested [in t-compiler meeting](https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.20meeting.5D.202020-12-17.20.2354818/near/220261541). *Note*: I was seeing some failing debuginfo-gdb tests locally but I wasn't sure if they were spurious.
2020-12-17docs: Edit rustc_span::symbol::Symbol methodpierwill-1/+1
Edit wording of the doc comment for rustc_span::symbol::Symbol::can_be_raw to match related methods.
2020-12-17Prefer regions with an `external_name` in `approx_universal_upper_bound`Aaron Hill-2/+46
Fixes #75785 When displaying a MIR borrowcheck error, we may need to find an upper bound for a region, which gives us a region to point to in the error message. However, a region might outlive multiple distinct universal regions, in which case the only upper bound is 'static To try to display a meaningful error message, we compute an 'approximate' upper bound by picking one of the universal regions. Currently, we pick the region with the lowest index - however, this caused us to produce a suboptimal error message in issue #75785 This PR `approx_universal_upper_bound` to prefer regions with an `external_name`. This causes us to prefer regions from function arguments/upvars, which seems to lead to a nicer error message in some cases.
2020-12-17Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakisbors-266/+319
Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.` r? `@nikomatsakis`
2020-12-17Continue String to Symbol conversion in rustdocGuillaume Gomez-69/+74
2020-12-17Revert "cg_llvm: `fewer_names` in `uncached_llvm_type`"David Wood-10/+3
This reverts commit fa01ce802f1b403a2140fd945b43af86ec3998a1.
2020-12-17Fix rebase conflictJoshua Nelson-4/+0
2020-12-17TODO -> FIXMEJoshua Nelson-1/+1
2020-12-17Fix error with `--cfg parallel_compiler`Joshua Nelson-1/+1
Apparently expansion() really does return Rc, not Lrc
2020-12-17Make it compileJoshua Nelson-72/+104
2020-12-17[tmp] Pass `TyCtxt` through to the render backendJoshua Nelson-17/+15
First actually useful step in https://github.com/rust-lang/rust/issues/76382 This doesn't yet compile because there's no way to get a `Lrc<Session>` from a TyCtxt, only a `&Session`.
2020-12-17Move `run_renderer` into the main `global_ctxt` closureJoshua Nelson-71/+81
2020-12-17Separate `create_resolver` into a new functionJoshua Nelson-36/+43
2020-12-17Split apart create_config and run_coreJoshua Nelson-21/+25
2020-12-17Change the message for `if_let_guard` feature gateLeSeulArtichaut-5/+5
2020-12-17Auto merge of #80113 - davidtwco:issue-80086-ci-llvm-stamp, r=Mark-Simulacrumbors-1/+1
bootstrap: update ci-llvm stamp after #80087 Fixes #80086. Unfortunately, #80087 forgot to update the ci-llvm stamp, so the updated ci-llvm tarball with `llvm-dwp` wasn't downloaded by users. This PR updates the ci-llvm stamp to resolve that problem. r? `@Mark-Simulacrum`
2020-12-17Address review commentsmibac138-7/+21
2020-12-17Auto merge of #80114 - GuillaumeGomez:rollup-gszr5kn, r=GuillaumeGomezbors-100/+97
Rollup of 5 pull requests Successful merges: - #80006 (BTreeMap: more expressive local variables in merge) - #80022 (BTreeSet: simplify implementation of pop_first/pop_last) - #80035 (Optimization for bool's PartialOrd impl) - #80040 (Always run intrinsics lowering pass) - #80047 (Use more symbols in rustdoc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-12-17Add test case for break expr with misspelled valueDaiki Ihara-2/+93
Update src/test/ui/loops/loop-break-value.rs Co-authored-by: Ivan Tham <pickfire@riseup.net>
2020-12-17Enhance error message when misspelled label to value in break expressionDaiki Ihara-0/+20
Apply suggestions from code review Co-authored-by: lcnr <bastian_kauschke@hotmail.de>