about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-03-26Always preserve `None`-delimited groups in a captured `TokenStream`Aaron Hill-28/+113
Previously, we would silently remove any `None`-delimiters when capturing a `TokenStream`, 'flattenting' them to their inner tokens. This was not normally visible, since we usually have `TokenKind::Interpolated` (which gets converted to a `None`-delimited group during macro invocation) instead of an actual `None`-delimited group. However, there are a couple of cases where this becomes visible to proc-macros: 1. A cross-crate `macro_rules!` macro has a `None`-delimited group stored in its body (as a result of being produced by another `macro_rules!` macro). The cross-crate `macro_rules!` invocation can then expand to an attribute macro invocation, which needs to be able to see the `None`-delimited group. 2. A proc-macro can invoke an attribute proc-macro with its re-collected input. If there are any nonterminals present in the input, they will get re-collected to `None`-delimited groups, which will then get captured as part of the attribute macro invocation. Both of these cases are incredibly obscure, so there hopefully won't be any breakage. This change will allow more agressive 'flattenting' of nonterminals in #82608 without losing `None`-delimited groups.
2021-03-26Auto merge of #83418 - ehuss:update-cargo, r=ehussbors-14/+33
Update cargo 12 commits in 90691f2bfe9a50291a98983b1ed2feab51d5ca55..1e8703890f285befb5e32627ad4e0a0454dde1fb 2021-03-16 21:36:55 +0000 to 2021-03-26 16:59:39 +0000 - tests: Tolerate "exit status" in error messages (rust-lang/cargo#9307) - Default macOS targets to `unpacked` debuginfo (rust-lang/cargo#9298) - Fix publication of packages with metadata and resolver (rust-lang/cargo#9300) - Fix config includes not working. (rust-lang/cargo#9299) - Emit note when `--future-incompat-report` had nothing to report (rust-lang/cargo#9263) - RFC 3052: Stop including authors field in manifests made by cargo new (rust-lang/cargo#9282) - Refactor feature handling, and improve error messages. (rust-lang/cargo#9290) - Split out cargo-util package for cargo-test-support. (rust-lang/cargo#9292) - Fix redundant_semicolons warning in resolver-tests. (rust-lang/cargo#9293) - Use serde's error message option to avoid implementing `Deserialize`. (rust-lang/cargo#9237) - Allow `cargo update` to operate with the --offline flag (rust-lang/cargo#9279) - Fix typo in faq.md (rust-lang/cargo#9285)
2021-03-26Update cargoEric Huss-14/+33
2021-03-26Auto merge of #83488 - Aaron1011:ban-expr-inner-attrs, r=petrochenkovbors-173/+257
Ban custom inner attributes in expressions and statements Split out from https://github.com/rust-lang/rust/pull/82608 Custom inner attributes are unstable, so this won't break any stable users. This allows us to speed up token collection, and avoid a redundant call to `collect_tokens_no_attrs` when parsing an `Expr` that has outer attributes. r? `@petrochenkov`
2021-03-26Auto merge of #83404 - michaelwoerister:issue83045, r=eddybbors-3/+44
Fix #83045 by moving some crate loading verification code to a better place r? `@eddyb`
2021-03-26Auto merge of #82980 - tmiasko:import-cold-multiplier, r=michaelwoeristerbors-0/+3
Import small cold functions The Rust code is often written under an assumption that for generic methods inline attribute is mostly unnecessary, since for optimized builds using ThinLTO, a method will be code generated in at least one CGU and available for import. For example, deref implementations for Box, Vec, MutexGuard, and MutexGuard are not currently marked as inline, neither is identity implementation of From trait. In PGO builds, when functions are determined to be cold, the default multiplier of zero will stop the import, no matter how trivial the implementation. Increase slightly the default multiplier from 0 to 0.1. r? `@ghost`
2021-03-26Auto merge of #83079 - osa1:issue83046, r=m-ou-sebors-19/+54
Update char::escape_debug_ext to handle different escapes in strings and chars Fixes #83046 The program fn main() { println!("{:?}", '"'); println!("{:?}", "'"); } would previously print '\"' "\'" With this patch it now prints: '"' "'"
2021-03-26Fix #83045 by moving some crate loading verification code to a better place.Michael Woerister-3/+44
2021-03-26Update char::escape_debug_ext to handle different escapes in strings vs. charsÖmer Sinan Ağacan-19/+54
Fixes #83046 The program fn main() { println!("{:?}", '"'); println!("{:?}", "'"); } would previously print '\"' "\'" With this patch it now prints: '"' "'"
2021-03-26Auto merge of #83480 - flip1995:clippyup, r=Dylan-DPCbors-2856/+5719
Update Clippy Bi-weekly Clippy update. r? `@Manishearth`
2021-03-26Auto merge of #83503 - Dylan-DPC:rollup-mqvjfav, r=Dylan-DPCbors-159/+393
Rollup of 8 pull requests Successful merges: - #83055 ([rustdoc] Don't document stripped items in JSON renderer.) - #83437 (Refactor #82270 as lint instead of an error) - #83444 (Fix bootstrap tests on beta) - #83456 (Add docs for Vec::from functions) - #83463 (ExitStatusExt: Fix missing word in two docs messages) - #83470 (Fix patch note about #80653 not mentioning nested nor recursive) - #83485 (Mark asm tests as requiring LLVM 10.0.1) - #83486 (Don't ICE when using `#[global_alloc]` on a non-item statement) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-03-26Rollup merge of #83486 - Aaron1011:fix/global-alloc-error, r=petrochenkovDylan DPC-16/+34
Don't ICE when using `#[global_alloc]` on a non-item statement Fixes #83469 We need to return an `Annotatable::Stmt` if we were passed an `Annotatable::Stmt`
2021-03-26Rollup merge of #83485 - Amanieu:asm_llvm10, r=joshtriplettDylan DPC-15/+15
Mark asm tests as requiring LLVM 10.0.1
2021-03-26Rollup merge of #83470 - danielhenrymantilla:patch-1, r=jyn514Dylan DPC-1/+1
Fix patch note about #80653 not mentioning nested nor recursive Which thus missed the point of the change: `rustdoc` already bundled documentation for methods accessible through one layer of `Deref`, it has now been enhanced to keep recursing 🙂 r? ``@jyn514``
2021-03-26Rollup merge of #83463 - ijackson:exitstatusext-doc-grammar, r=kennytmDylan DPC-2/+2
ExitStatusExt: Fix missing word in two docs messages Looks like I missed the lack of these "and"s.
2021-03-26Rollup merge of #83456 - notriddle:vec-from-docs, r=JohnTitorDylan DPC-0/+61
Add docs for Vec::from functions Part of #51430
2021-03-26Rollup merge of #83444 - Mark-Simulacrum:bootstrap-beta, r=pietroalbiniDylan DPC-0/+3
Fix bootstrap tests on beta Forward-porting a fix from the beta branch, which led to test failure on beta. r? ``@pietroalbini``
2021-03-26Rollup merge of #83437 - Amanieu:asm_syntax, r=petrochenkovDylan DPC-118/+179
Refactor #82270 as lint instead of an error This PR fixes several issues with #82270 which generated an error when `.intel_syntax` or `.att_syntax` was used in inline assembly: - It is now a warn-by-default lint instead of an error. - The lint only triggers on x86. `.intel_syntax` and `.att_syntax` are only valid on x86. - The lint no longer provides machine-applicable suggestions for two reasons: - These changes should not be made automatically since changes to assembly code can be very subtle. - The template string is not always just a string: it can contain macro invocation (`concat!`), raw strings, escape characters, etc. cc ``@asquared31415``
2021-03-26Rollup merge of #83055 - aDotInTheVoid:selective-strip-item-doc, r=jyn514Dylan DPC-7/+98
[rustdoc] Don't document stripped items in JSON renderer. Fixes #80664, see [my comment there](https://github.com/rust-lang/rust/issues/80664#issuecomment-797557948) for why Note that we already do something similar in `convert_item`: https://github.com/rust-lang/rust/blob/bb4cdf8ec034dca5c056ec9295f38062e5b7e871/src/librustdoc/json/conversions.rs#L28-L31 ``@rustbot`` modify labels: +T-rustdoc +A-rustdoc-json r? ``@jyn514`` cc ``@CraftSpider``
2021-03-26Auto merge of #83465 - michaelwoerister:safe-read_raw_bytes, r=cjgillotbors-45/+48
Allow for reading raw bytes from rustc_serialize::Decoder without unsafe code The current `read_raw_bytes` method requires using `MaybeUninit` and `unsafe`. I don't think this is necessary. Let's see if a safe interface has any performance drawbacks. This is a followup to #83273 and will make it easier to rebase #82183. r? `@cjgillot`
2021-03-25Auto merge of #82873 - GuillaumeGomez:rustdoc-const-ty, r=jyn514bors-634/+840
Rework rustdoc const type This PR is mostly about two things: 1. Not storing some information in the `clean::Constant` type 2. Using `TyCtxt` in the formatting (which we will need in any case as we move forward in any case). Also: I'm very curious of the perf change in here. Thanks a lot `@danielhenrymantilla` for your `Captures` idea! It allowed me to solve the lifetime issue completely. :) r? `@jyn514`
2021-03-25Avoid double-collection for expression nonterminalsAaron Hill-17/+17
2021-03-25Ban custom inner attributes in expressions and statementsAaron Hill-156/+240
2021-03-25Mark inline asm tests as requiring LLVM 10.0.1Amanieu d'Antras-15/+15
2021-03-25Don't ICE when using `#[global_alloc]` on a non-item statementAaron Hill-16/+34
Fixes #83469 We need to return an `Annotatable::Stmt` if we were passed an `Annotatable::Stmt`
2021-03-25Auto merge of #82743 - jackh726:resolve-refactor, r=nikomatsakisbors-610/+581
Refactor rustc_resolve::late::lifetimes to resolve per-item There are some changes to tests that I'd like some feedback on; so this is still WIP. The reason behind this change will (hopefully) allow us to (as part of #76814) be able to essentially use the lifetime resolve code to resolve *all* late bound vars (including those of super traits). Currently, it only resolves those that are *syntactically* in scope. In #76814, I'm essentially finding that I would essentially have to redo the passing of bound vars through scopes (i.e. when instantiating a poly trait ref), and that's what this code does anyways. However, to be able to do this (ask super traits what bound vars are in scope), we have to be able to resolve items separately. The first commit is actually partially orthogonal. Essentially removing one use of late bound debruijn indices. Not exactly sure who would be best to review here. Let r? `@nikomatsakis`
2021-03-25Update Cargo.lockflip1995-8/+5
2021-03-25Merge commit '0e87918536b9833bbc6c683d1f9d51ee2bf03ef1' into clippyupflip1995-2848/+5714
2021-03-25Bless nll testJack Huey-84/+3
2021-03-25Auto merge of #6971 - flip1995:rustup, r=flip1995bors-156/+145
Rustup r? `@ghost` changelog: none
2021-03-25Bump Clippy Version -> 0.1.53flip1995-3/+3
2021-03-25Bump nightly version -> 2021-03-25flip1995-1/+1
2021-03-25Merge remote-tracking branch 'upstream/master' into rustupflip1995-2863/+5719
2021-03-25Auto merge of #83424 - cjgillot:noparam, r=lcnrbors-54/+6
GenericParam does not need to be a HIR owner. The special case is not required. Universal impl traits design to regular generic parameters, and their content is owned by the enclosing item. Existential (and opaque) impl traits generate their own enclosing item, and are collected through it.
2021-03-25Fix patch note about #80653 not mentioning nested nor recursiveDaniel Henry-Mantilla-1/+1
Which thus missed the point of the change: `rustdoc` already bundled documentation for methods accessible through one layer of `Deref`, it now has been enhanced to keep recursing 🙂
2021-03-25write-up what is happeningNiko Matsakis-0/+28
2021-03-25Refactor #82270 as lint instead of an errorAmanieu d'Antras-118/+179
2021-03-25Auto merge of #83387 - cuviper:min-llvm-10, r=nagisabors-137/+19
Update the minimum external LLVM to 10 r? `@nikic`
2021-03-25Allow for reading raw bytes from rustc_serialize::Decoder without unsafe code.Michael Woerister-45/+48
2021-03-25ExitStatusExt: Fix missing word in two docs messagesIan Jackson-2/+2
Looks like I missed the lack of these "and"s. Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-03-25Auto merge of #82565 - m-ou-se:ununstabilize-bits, r=kennytmbors-11/+2
Revert reverting of stabilizing integer::BITS. Now that `lexical-core` has an updated version that won't break with this stabilization, let's try to stabilize this again. See https://github.com/rust-lang/rust/issues/81654#issuecomment-778564715 Tracking issue with FCP: https://github.com/rust-lang/rust/issues/76904
2021-03-25Change wordingMichael Howell-2/+2
2021-03-25Auto merge of #83445 - erikdesjardins:rmunion, r=RalfJungbors-1/+65
RemoveZsts: don't touch unions This should fix a Miri ICE r? `@RalfJung`
2021-03-25Auto merge of #83307 - richkadel:cov-unused-functions-1.1, r=tmandrybors-342/+3065
coverage bug fixes and optimization support Adjusted LLVM codegen for code compiled with `-Zinstrument-coverage` to address multiple, somewhat related issues. Fixed a significant flaw in prior coverage solution: Every counter generated a new counter variable, but there should have only been one counter variable per function. This appears to have bloated .profraw files significantly. (For a small program, it increased the size by about 40%. I have not tested large programs, but there is anecdotal evidence that profraw files were way too large. This is a good fix, regardless, but hopefully it also addresses related issues. Fixes: #82144 Invalid LLVM coverage data produced when compiled with -C opt-level=1 Existing tests now work up to at least `opt-level=3`. This required a detailed analysis of the LLVM IR, comparisons with Clang C++ LLVM IR when compiled with coverage, and a lot of trial and error with codegen adjustments. The biggest hurdle was figuring out how to continue to support coverage results for unused functions and generics. Rust's coverage results have three advantages over Clang's coverage results: 1. Rust's coverage map does not include any overlapping code regions, making coverage counting unambiguous. 2. Rust generates coverage results (showing zero counts) for all unused functions, including generics. (Clang does not generate coverage for uninstantiated template functions.) 3. Rust's unused functions produce minimal stubbed functions in LLVM IR, sufficient for including in the coverage results; while Clang must generate the complete LLVM IR for each unused function, even though it will never be called. This PR removes the previous hack of attempting to inject coverage into some other existing function instance, and generates dedicated instances for each unused function. This change, and a few other adjustments (similar to what is required for `-C link-dead-code`, but with lower impact), makes it possible to support LLVM optimizations. Fixes: #79651 Coverage report: "Unexecuted instantiation:..." for a generic function from multiple crates Fixed by removing the aforementioned hack. Some "Unexecuted instantiation" notices are unavoidable, as explained in the `used_crate.rs` test, but `-Zinstrument-coverage` has new options to back off support for either unused generics, or all unused functions, which avoids the notice, at the cost of less coverage of unused functions. Fixes: #82875 Invalid LLVM coverage data produced with crate brotli_decompressor Fixed by disabling the LLVM function attribute that forces inlining, if `-Z instrument-coverage` is enabled. This attribute is applied to Rust functions with `#[inline(always)], and in some cases, the forced inlining breaks coverage instrumentation and reports. FYI: `@wesleywiser` r? `@tmandry`
2021-03-25Auto merge of #6959 - ebobrow:iss-6927-fix, r=camsteffenbors-3/+56
Check for `.to_string().into_bytes()` in string_lit_to_bytes fixes #6927 changelog: Add a check for `into_bytes()` to string_lit_to_bytes lint
2021-03-25Auto merge of #83454 - JohnTitor:rollup-9ae0565, r=JohnTitorbors-141/+96
Rollup of 8 pull requests Successful merges: - #83041 (stabilize debug_non_exhaustive) - #83349 (Remove Option::{unwrap_none, expect_none}.) - #83420 (Add documentation for rustdoc-gui tests) - #83421 (Add Result::into_err where the Ok variant is the never type) - #83427 (small cleanups in rustc_errors / emitter) - #83434 (Update RELEASES.md) - #83440 (Use intra-doc link in core::cell) - #83442 (LLVMWrapper: attractive nuisance macros) Failed merges: - #83438 (Update RELEASES.md) r? `@ghost` `@rustbot` modify labels: rollup
2021-03-24Add docs for Vec::from functionsMichael Howell-0/+61
Part of #51430
2021-03-24check for `.to_string().into_bytes()` in string_lit_to_bytesElliot Bobrow-3/+56
apply changes from review
2021-03-25Rollup merge of #83442 - durin42:remove-questionable-macros, r=cuviperYuki Okushi-7/+0
LLVMWrapper: attractive nuisance macros This came up in the review of #83425: it's hard to imagine a use of LLVM_VERSION_LE() or LLVM_VERSION_EQ() that's not asking for trouble when a point release gets created, so let's just discard them to prevent the issue.
2021-03-25Rollup merge of #83440 - fee1-dead:core-cell-intralink, r=jyn514Yuki Okushi-1/+1
Use intra-doc link in core::cell ``@rustbot`` label T-doc A-intra-doc-links r? ``@jyn514``