about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-11-02Auto merge of #78661 - JohnTitor:rollup-er2isja, r=JohnTitorbors-55/+25
Rollup of 5 pull requests Successful merges: - #78606 (Clarify handling of final line ending in str::lines()) - #78610 (Do not remove tokens before AST json serialization) - #78620 (Trivial fixes to bitwise operator documentation) - #78627 (Point out that total_cmp is no strict superset of partial comparison) - #78637 (Add fetch_update methods to AtomicBool and AtomicPtr) Failed merges: r? `@ghost`
2020-11-02Only separate notes if span is multilineYuki Okushi-6/+3
2020-11-02Add "this has type `{}` which {}" noteYuki Okushi-0/+13
2020-11-02Address some code reviewsYuki Okushi-16/+4
2020-11-02Separate complex multispan into some notesYuki Okushi-25/+30
2020-11-02Avoid complex diagnostics in snippets which contain newlinesYuki Okushi-0/+56
2020-11-02Rollup merge of #78610 - petrochenkov:nostriptok, r=Aaron1011Yuki Okushi-55/+25
Do not remove tokens before AST json serialization `TokenStripper` is error-prone and introduces one more use of `MutVisitor`. It's much simpler to treat serialization as just one more place that wants lazy token stream to turn into a real token stream. Also, no code is better than more code, in general. r? @Aaron1011 (I also merged tests for `TokenStripper` ICEs into one.)
2020-11-01Add delay_span_bug to no longer ICEkadmin-0/+16
2020-11-01Auto merge of #75534 - Aaron1011:feature/new-future-breakage, r=pnkfelixbors-9/+201
Implement rustc side of report-future-incompat cc https://github.com/rust-lang/rust/issues/71249 This is an alternative to `@pnkfelix's` initial implementation in https://github.com/pnkfelix/rust/commits/prototype-rustc-side-of-report-future-incompat (mainly because I started working before seeing that branch :smile: ). My approach outputs the entire original `Diagnostic`, in a way that is compatible with incremental compilation. This is not yet integrated with compiletest, but can be used manually by passing `-Z emit-future-incompat-report` to `rustc`. Several changes are made to support this feature: * The `librustc_session/lint` module is moved to a new crate `librustc_lint_defs` (name bikesheddable). This allows accessing lint definitions from `librustc_errors`. * The `Lint` struct is extended with an `Option<FutureBreakage>`. When present, it indicates that we should display a lint in the future-compat report. `FutureBreakage` contains additional information that we may want to display in the report (currently, a `date` field indicating when the crate will stop compiling). * A new variant `rustc_error::Level::Allow` is added. This is used when constructing a diagnostic for a future-breakage lint that is marked as allowed (via `#[allow]` or `--cap-lints`). This allows us to capture any future-breakage diagnostics in one place, while still discarding them before they are passed to the `Emitter`. * `DiagnosticId::Lint` is extended with a `has_future_breakage` field, indicating whether or not the `Lint` has future breakage information (and should therefore show up in the report). * `Session` is given access to the `LintStore` via a new `SessionLintStore` trait (since `librustc_session` cannot directly reference `LintStore` without a cyclic dependency). We use this to turn a string `DiagnosticId::Lint` back into a `Lint`, to retrieve the `FutureBreakage` data. Currently, `FutureBreakage.date` is always set to `None`. However, this could potentially be interpreted by Cargo in the future. I've enabled the future-breakage report for the `ARRAY_INTO_ITER` lint, which can be used to test out this PR. The intent is to use the field to allow Cargo to determine the date of future breakage (as described in [RFC 2834](https://github.com/rust-lang/rfcs/blob/master/text/2834-cargo-report-future-incompat.md)) without needing to parse the diagnostic itself. cc `@pnkfelix`
2020-11-01Auto merge of #78553 - Nadrieril:fix-78549, r=varkorbors-6/+31
Fix #78549 Before #78430, this worked because `specialize_constructor` didn't actually care too much which constructor was passed to it unless needed. That PR however handles `&str` as a special case, and I did not anticipate patterns for the `&str` type other than string literals. I am not very confident there are not other similar oversights left, but hopefully only `&str` was different enough to break my assumptions. Fixes https://github.com/rust-lang/rust/issues/78549
2020-11-01Auto merge of #78420 - estebank:suggest-assoc-fn, r=petrochenkovbors-22/+69
Suggest calling associated `fn` inside `trait`s When calling a function that doesn't exist inside of a trait's associated `fn`, and another associated `fn` in that trait has that name, suggest calling it with the appropriate fully-qualified path. Expand the label to be more descriptive. Prompted by the following user experience: https://users.rust-lang.org/t/cannot-find-function/50663
2020-11-01Fix #78549Nadrieril-6/+31
Before #78430, string literals worked because `specialize_constructor` didn't actually care too much which constructor was passed to it unless needed. Since then, string literals are special cased and a bit hacky. I did not anticipate patterns for the `&str` type other than string literals, hence this bug. This makes string literals less hacky.
2020-11-01Do not remove tokens before AST json serializationVadim Petrochenkov-55/+25
2020-10-31Assert that locals have storage when usedTomasz Miąsko-0/+3
The validator in visit_local asserts that local has a stroage when used, but visit_local is never called so validation is ineffective. Use super_statement and super_terminator to ensure that locals are visited.
2020-10-31Rollup merge of #78550 - jyn514:setup, r=Mark-SimulacrumMara Bos-1/+1
x.py setup: Create config.toml in the current directory, not the top-level directory See https://github.com/rust-lang/rust/issues/78509 for discussion. r? @pnkfelix cc @cuviper @Mark-Simulacrum
2020-10-31Rollup merge of #78526 - Aaron1011:fix/assoc-tokens, r=estebankMara Bos-0/+34
Strip tokens from trait and impl items before printing AST JSON Fixes #78510
2020-10-30Update Clippy path to `Lint`Aaron Hill-1/+1
2020-10-31Auto merge of #76257 - JulianKnodt:i75777, r=Dylan-DPCbors-0/+60
Add regression test This adds a regression test for #75777, effectively closing it since it is solved on nightly and beta. Closes #75777
2020-10-30Always pass `-Z future-incompat-report` to UI testsAaron Hill-28/+27
2020-10-30Don't display empty future-compat reportAaron Hill-16/+21
2020-10-30Update into-iter-on-arrays test to check future-incompat-reportAaron Hill-12/+165
2020-10-30Only error on unfixed diagnosticsAaron Hill-1/+3
2020-10-30Strip out non-diagnostic lines from rustfix inputAaron Hill-7/+20
2020-10-30Print future breakage reportAaron Hill-6/+9
2020-10-30Some workAaron Hill-14/+31
2020-10-30Auto merge of #78182 - LeSeulArtichaut:ty-visitor-contolflow, r=lcnr,oli-obkbors-4/+6
TypeVisitor: use `std::ops::ControlFlow` instead of `bool` Implements MCP rust-lang/compiler-team#374. Blocked on FCP in rust-lang/compiler-team#374. r? `@lcnr` cc `@jonas-schievink`
2020-10-30Remove implicit `Continue` typeLeSeulArtichaut-1/+1
2020-10-30Use `ControlFlow::is{break,continue}`LeSeulArtichaut-2/+2
2020-10-30TypeVisitor: use `ControlFlow` in clippyLeSeulArtichaut-4/+6
2020-10-30Auto merge of #78562 - JohnTitor:rollup-otg906u, r=JohnTitorbors-21/+33
Rollup of 8 pull requests Successful merges: - #77334 (Reorder benches const variable) - #77888 (Simplify a nested bool match) - #77921 (f64: Refactor collapsible_if) - #78523 (Revert invalid `fn` return type parsing change) - #78524 (Avoid BorrowMutError with RUSTC_LOG=debug) - #78545 (Make anonymous binders start at 0) - #78554 (Improve wording of `core::ptr::drop_in_place` docs) - #78556 (Link to pass docs from NRVO module docs) Failed merges: - #78424 (Fix some more clippy warnings) r? `@ghost`
2020-10-30Rollup merge of #78545 - jackh726:anonymous, r=oli-obkYuki Okushi-16/+16
Make anonymous binders start at 0 A few changes to some test outputs, but these actually look *more* correct to me.
2020-10-30Rollup merge of #78524 - tmiasko:source-files-borrow, r=Aaron1011Yuki Okushi-1/+7
Avoid BorrowMutError with RUSTC_LOG=debug ```console $ touch empty.rs $ env RUSTC_LOG=debug rustc +stage1 --crate-type=lib empty.rs ``` Fails with a `BorrowMutError` because source map files are already borrowed while `features_query` attempts to format a log message containing a span. Release the borrow before the query to avoid the issue.
2020-10-30Rollup merge of #78523 - estebank:fix-return-type-parse-regression, r=dtolnayYuki Okushi-4/+10
Revert invalid `fn` return type parsing change Revert one of the changes in #78379. Fix #78507.
2020-10-30Add regression testkadmin-0/+60
2020-10-30Auto merge of #78393 - SNCPlay42:match-if-guard, r=tmandrybors-1/+20
Always record reference to binding in match if guards When encountering a binding from a `match` pattern in its `if` guard when computing a generator's interior types, we must always record the type of a reference to the binding because of how `if` guards are lowered to MIR. This was missed in #75213 because the binding in that test case was autorefed and we recorded that adjusted type anyway. Fixes #78366
2020-10-30Auto merge of #78432 - sexxi-goose:fix-77993-take3, r=nikomatsakisbors-0/+45
Handle type errors in closure/generator upvar_tys Fixes #77993
2020-10-29Create config.toml in the current directory, not the top-level directoryJoshua Nelson-1/+1
See https://github.com/rust-lang/rust/issues/78509 for discussion.
2020-10-30Auto merge of #78540 - RalfJung:miri, r=RalfJungbors-7/+7
update Miri Cc `@rust-lang/miri` r? `@ghost`
2020-10-29Make anonymous binders start at 0Jack Huey-16/+16
2020-10-29update MiriRalf Jung-7/+7
2020-10-29Rollup merge of #78505 - ebroto:clippyup, r=oli-obkJonas Schievink-672/+2832
Update Clippy - temporary_cstring_as_ptr deprecation In #75671 `clippy::temporary_cstr_as_ptr` was removed instead of being deprecated. This will trigger an error (unknown lint) for users that refer to that lint to e.g. allow it, instead of a more informative warning. This update should fix that for nightly users. r? @oli-obk
2020-10-29Rollup merge of #78493 - ehuss:update-cargo, r=ehussJonas Schievink-0/+0
Update cargo 8 commits in dd83ae55c871d94f060524656abab62ec40b4c40..becb4c282b8f37469efb8f5beda45a5501f9d367 2020-10-20 19:31:26 +0000 to 2020-10-28 16:41:55 +0000 - List available packages if providing `--package` with an empty value (rust-lang/cargo#8808) - Add a future-compatibility warning on allowed feature name characters. (rust-lang/cargo#8814) - New namespaced features implementation. (rust-lang/cargo#8799) - Remove redundant "For example, " (rust-lang/cargo#8810) - Document platform-specific build-dependencies (rust-lang/cargo#8809) - Remove some unused code. (rust-lang/cargo#8807) - Some minor clippy fixes. (rust-lang/cargo#8804) - Update TOML website links. (rust-lang/cargo#8803)
2020-10-29Rollup merge of #78431 - Rustin-Liu:rustin-patch-lint, r=estebankJonas Schievink-4/+4
Prefer new associated numeric consts in float error messages Fix https://github.com/rust-lang/rust/issues/78382
2020-10-29Rollup merge of #78422 - estebank:fix-78372, r=pnkfelixJonas Schievink-0/+76
Do not ICE on invalid input Fix #78372.
2020-10-29Strip tokens from trait and impl items before printing AST JSONAaron Hill-0/+34
Fixes #78510
2020-10-29Add regression testEsteban Küber-0/+6
2020-10-29Revert invalid `fn` return type parsing changeEsteban Küber-4/+4
Fix #78507.
2020-10-29Auto merge of #78506 - cuviper:ubuntu-lts, r=pietroalbinibors-2/+4
ci: update x86_64-gnu and x86_64-gnu-debug to ubuntu:20.04 The former `ubuntu:19.10` reached EOL in July, 2020, whereas `ubuntu:20.04` is an LTS release supported until 2025. These are non-dist CI images, so the impact should be low.
2020-10-29Auto merge of #78486 - pietroalbini:manifest-artifacts, r=Mark-Simulacrumbors-22/+125
Include non-rustup artifacts in the manifest This PR fixes https://github.com/rust-lang/promote-release/issues/22 by including all the files we ship in the generated manifests, even the ones that are not installable through rustup. In practice this adds the following "artifacts": * `source-code`: the tarball containing the full source code used to build the release (`rustc-{channel}-src.tar.xz`) * `installer-msi`: the MSI installer for Windows systems (`rust-{channel}-{target}.msi`) * `installer-pkg`: the PKG installer for macOS systems (`rust-{channel}-{target}.pkg`) These files are included in a new `artifacts` table of the manifest, like so: ```toml [[artifacts.installer-msi.target.aarch64-pc-windows-msvc]] url = "https://example.com/2020-10-28/rust-nightly-aarch64-pc-windows-msvc.msi" hash-sha256 = "6b41d5b829d20834c5d93628d008ec618f8914ee79303363bd13a86fd5f305dd" [[artifacts.installer-msi.target.i686-pc-windows-gnu]] url = "https://example.com/2020-10-28/rust-nightly-i686-pc-windows-gnu.msi" hash-sha256 = "83f020de6e180c155add9fce1cea2ac6e5f744edbd6dc1581e24de8f56b2ca7a" [[artifacts.installer-msi.target.i686-pc-windows-msvc]] url = "https://example.com/2020-10-28/rust-nightly-i686-pc-windows-msvc.msi" hash-sha256 = "dbc80c24e9d5df01616c6f216114b4351f51a94218e2368b5cebe4165b270702" [[artifacts.installer-msi.target.x86_64-pc-windows-gnu]] url = "https://example.com/2020-10-28/rust-nightly-x86_64-pc-windows-gnu.msi" hash-sha256 = "8196eca3f02d72d4c8776ad4fcc72897125e2cf6404ae933e31c07e197e3c9fa" [[artifacts.installer-msi.target.x86_64-pc-windows-msvc]] url = "https://example.com/2020-10-28/rust-nightly-x86_64-pc-windows-msvc.msi" hash-sha256 = "b2e7fd6463790732fcf9c726b9448068712341943199cb40fc11d1138b8a207b" [[artifacts.installer-pkg.target.aarch64-apple-darwin]] url = "https://example.com/2020-10-28/rust-nightly-aarch64-apple-darwin.pkg" hash-sha256 = "70421c191752fb33886f8033b029e634bcc993b72308cef52a38405840e91f5c" [[artifacts.installer-pkg.target.x86_64-apple-darwin]] url = "https://example.com/2020-10-28/rust-nightly-x86_64-apple-darwin.pkg" hash-sha256 = "ebd7a5acb61e82d85e855146cc9bd856f32228ee7f40dd94c659b00614ed4f1f" [[artifacts.source-code.target."*"]] url = "https://example.com/2020-10-28/rustc-nightly-src.tar.gz" hash-sha256 = "5fcc487ee4c15c689de8ddf7daac7ff6a65c80498197b9aea58622dc2b3bca10" [[artifacts.source-code.target."*"]] url = "https://example.com/2020-10-28/rustc-nightly-src.tar.xz" hash-sha256 = "0c618ef0ec5f64da1801e9d0df6c755f6ed1a8780ec5c8ee75e55614be51d42c" ``` Each artifact can be available for multiple targets, and each target can have multiple versions of the same file (for example, a `gz`-compressed one and a `xz`-compressed one). In the future rustup might add functionality to let users retrieve the artifacts, but that's not needed to land this PR, and whether to do the implementation is up to the rustup maintainers. r? `@kinnison` cc `@Mark-Simulacrum`
2020-10-29Auto merge of #78512 - JohnTitor:rollup-a7qwjah, r=JohnTitorbors-71/+469
Rollup of 11 pull requests Successful merges: - #77213 (rustdoc options to set default theme (and other settings)) - #78224 (min_const_generics: allow ty param in repeat expr) - #78428 (MinConstGenerics UI test for invalid values for bool & char) - #78460 (Adjust turbofish help message for const generics) - #78470 (Clean up intra-doc links in `std::path`) - #78475 (fix a comment in validity check) - #78478 (Add const generics tests for supertraits + dyn traits.) - #78487 (Fix typo "compiltest") - #78491 (Inline NonZeroN::from(n)) - #78492 (Update books) - #78494 (Fix typos) Failed merges: r? `@ghost`