about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-09-17doc/platform-support.md: Add m68k-unknown-linux-gnu as Tier 3 targetJohn Paul Adrian Glaubitz-0/+1
2021-09-17rustdoc: Add human-readable cfg string for m68kJohn Paul Adrian Glaubitz-0/+1
2021-09-17compiletest: Add m68k to ARCH_TABLEJohn Paul Adrian Glaubitz-0/+1
2021-09-17ci: Add Dockerfile for dist-m68k-linuxJohn Paul Adrian Glaubitz-0/+26
2021-09-17build-manifest: Add m68k-unknown-linux-gnu targetJohn Paul Adrian Glaubitz-0/+1
2021-09-17bootstrap: Add LLVM target matching for M68kJohn Paul Adrian Glaubitz-1/+1
2021-09-17bootstrap: Add cputype matching for m68kJohn Paul Adrian Glaubitz-0/+1
2021-09-17Correctly handle "--open" option when building compiler docsGuillaume Gomez-0/+9
2021-09-17Allow to pass "compiler" arguments to doc subcommandGuillaume Gomez-10/+44
2021-09-17Apply review commentsYuki Okushi-4/+6
2021-09-17Rollup merge of #89033 - cuviper:sysroot-lib-path, r=Mark-SimulacrumYuki Okushi-0/+13
Set the library path in sysroot-crates-are-unstable Most of the `run-make-fulldeps` tests use a make-driven rustc command that includes `HOST_RPATH_DIR` in the library path, but this particular test runs from python instead. When the toolchain is built without `rpath` enabled, we need that library path in the environment so it can find its own libraries.
2021-09-17Rollup merge of #88911 - FabianWolff:issue-88653, r=petrochenkovYuki Okushi-0/+31
Improve error message for type mismatch in generator arguments Fixes #88653. The code example given there is invalid because the `Generator` trait (unlike the `Fn` traits) does not take the generator arguments in tupled-up form (because there can only be one argument, from my understanding). Hence, the type error in the example in #88653 is correct, because the given generator takes a `bool` argument, whereas the function's return type talks about a generator with a `(bool,)` argument. The error message is both confusing and wrong, though: It is wrong because it displays the wrong "expected signature", and it is confusing because both the "expected" and "found" notes point at the same span. With my changes, I get the following, more helpful output: ``` error[E0631]: type mismatch in generator arguments --> test.rs:5:22 | 5 | fn foo(bar: bool) -> impl Generator<(bool,)> { | ^^^^^^^^^^^^^^^^^^^^^^^ expected signature of `fn((bool,)) -> _` 6 | |bar| { | ----- found signature of `fn(bool) -> _` ```
2021-09-17Rollup merge of #88883 - c410-f3r:tests, r=petrochenkovYuki Okushi-37/+2
Move some tests to more reasonable directories - 7 cc #73494 r? ``@petrochenkov``
2021-09-17Rollup merge of #88735 - hnj2:patch-1, r=GuillaumeGomezYuki Okushi-0/+10
Don't lint about missing code examples in derived traits When the `missing_doc_code_examples` lint is performed it also requires that derived Trait implementations have a code example for each member etc., which causes undesirable behavior. # Examples With `missing_doc_code_examples` enable we are not able to use the `Clone` derive macro due to the generated code not being documented: ```rust #[deny(rustdoc::missing_doc_code_examples)] /// docs /// ``` /// let s = SomeStruct; /// ``` #[derive(Clone)] pub struct SomeStruct; ``` yields: ``` Documenting testt v0.1.0 (<redacted>) error: missing code example in this documentation --> src/lib.rs:7:10 | 7 | #[derive(Clone)] | ^^^^^ | note: the lint level is defined here --> src/lib.rs:1:8 | 1 | #[deny(rustdoc::missing_doc_code_examples)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing code example in this documentation --> src/lib.rs:7:10 | 7 | #[derive(Clone)] | ^^^^^ error: could not document `testt` Caused by: process didn't exit successfully: `rustdoc ... ``` closes #81775
2021-09-17Rollup merge of #87529 - FabianWolff:issue-87496, r=nikomatsakisYuki Okushi-0/+28
Fix ICE in `improper_ctypes_definitions` lint with all-ZST transparent types Fixes #87496. There is also another function in the same file that looks fishy, but I haven't been able to produce an ICE there, and in any case, it's not related to #87496: https://github.com/rust-lang/rust/blob/fd853c00e255559255885aadff9e93a1760c8728/compiler/rustc_lint/src/types.rs#L720-L734 r? ```@JohnTitor```
2021-09-17Recover invalid assoc type bounds using `==`Yuki Okushi-0/+40
2021-09-17Use `multipart_suggestion`Yuki Okushi-3/+7
2021-09-17Emit clearer diagnostics for parens around `for` loop headsYuki Okushi-5/+4
2021-09-17Make diagnostics clearer for `?` operatorsYuki Okushi-2/+25
2021-09-16Set the library path in sysroot-crates-are-unstableJosh Stone-0/+13
Most of the `run-make-fulldeps` tests use a make-driven rustc command that includes `HOST_RPATH_DIR` in the library path, but this particular test runs from python instead. When the toolchain is built without `rpath` enabled, we need that library path in the environment so it can find its own libraries.
2021-09-17Don't lint about missing code examples in derived traitsHans-0/+10
Fixes #81775
2021-09-16Auto merge of #88719 - estebank:point-at-arg-for-obligation, r=nagisabors-335/+690
Point at argument instead of call for their obligations When an obligation is introduced by a specific `fn` argument, point at the argument instead of the `fn` call if the obligation fails to be fulfilled. Move the information about pointing at the call argument expression in an unmet obligation span from the `FulfillmentError` to a new `ObligationCauseCode`. When giving an error about an obligation introduced by a function call that an argument doesn't fulfill, and that argument is a block, add a span_label pointing at the innermost tail expression. Current output: ``` error[E0425]: cannot find value `x` in this scope --> f10.rs:4:14 | 4 | Some(x * 2) | ^ not found in this scope error[E0277]: expected a `FnOnce<({integer},)>` closure, found `Option<_>` --> f10.rs:2:31 | 2 | let p = Some(45).and_then({ | ______________________--------_^ | | | | | required by a bound introduced by this call 3 | | |x| println!("doubling {}", x); 4 | | Some(x * 2) | | ----------- 5 | | }); | |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<_>` | = help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>` ``` Previous output: ``` error[E0425]: cannot find value `x` in this scope --> f10.rs:4:14 | 4 | Some(x * 2) | ^ not found in this scope error[E0277]: expected a `FnOnce<({integer},)>` closure, found `Option<_>` --> f10.rs:2:22 | 2 | let p = Some(45).and_then({ | ^^^^^^^^ expected an `FnOnce<({integer},)>` closure, found `Option<_>` | = help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>` ``` Partially address #27300. Will require rebasing on top of #88546.
2021-09-16feat(rustc_parse): recover from pre-RFC-2000 const generics syntaxMichael Howell-0/+178
Fixes #89013
2021-09-16Propagate coercion cause into `try_coerce`Aaron Hill-14/+14
Currently, `coerce_inner` discards its `ObligationCause` when calling `try_coerce`. This interfers with other diagnostc improvements I'm working on, since we will lose the original span by the time the actual coercion occurs. Additionally, we now use the span of the trailing expression (rather than the span of the entire function) when performing a coercion in `check_return_expr`. This currently has no visible effect on any of the unit tests, but will unblock future diagnostic improvements.
2021-09-16Auto merge of #89019 - Manishearth:rollup-5qp8a5s, r=Manishearthbors-67/+86
Rollup of 10 pull requests Successful merges: - #88292 (Enable --generate-link-to-definition for rustc's docs) - #88729 (Recover from `Foo(a: 1, b: 2)`) - #88875 (cleanup(rustc_trait_selection): remove vestigial code from rustc_on_unimplemented) - #88892 (Move object safety suggestions to the end of the error) - #88928 (Document the closure arguments for `reduce`.) - #88976 (Clean up and add doc comments for CStr) - #88983 (Allow calling `get_body_with_borrowck_facts` without `-Z polonius`) - #88985 (Update clobber_abi list to include k[1-7] regs) - #88986 (Update the backtrace crate) - #89009 (Fix typo in `break` docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-09-16Add a separate error for `dyn Trait` in `const fn`Waffle-18/+18
Previously "trait bounds other than `Sized` on const fn parameters are unstable" error was used for both trait bounds (<T: Trait>) and trait objects (dyn Trait). This was pretty confusing. This patch adds a separeta error for trait objects: "trait objects in const fn are unstable". The error for trait bounds is otherwise intact.
2021-09-16Rollup merge of #88985 - Commeownist:patch-1, r=AmanieuManish Goregaokar-3/+3
Update clobber_abi list to include k[1-7] regs
2021-09-16Rollup merge of #88892 - estebank:trait-objects, r=petrochenkovManish Goregaokar-40/+40
Move object safety suggestions to the end of the error
2021-09-16Rollup merge of #88729 - estebank:struct-literal-using-parens, r=oli-obkManish Goregaokar-24/+42
Recover from `Foo(a: 1, b: 2)` Detect likely `struct` literal using parentheses as delimiters and emit targeted suggestion instead of type ascription parse error. Fix #61326.
2021-09-16Rollup merge of #88292 - SkiFire13:enable-rustdoc-links, r=jyn514Manish Goregaokar-0/+1
Enable --generate-link-to-definition for rustc's docs cc `@jyn514`
2021-09-16Add `ConstraintCategory::Usage` for handling aggregate constructionAaron Hill-25/+27
In some cases, we emit borrowcheck diagnostics pointing at a particular field expression in a struct expression (e.g. `MyStruct { field: my_expr }`). However, this behavior currently relies on us choosing the `ConstraintCategory::Boring` with the 'correct' span. When adding additional variants to `ConstraintCategory`, (or changing existing usages away from `ConstraintCategory::Boring`), the current behavior can easily get broken, since a non-boring constraint will get chosen over a boring one. To make the diagnostic output less fragile, this commit adds a `ConstraintCategory::Usage` variant. We use this variant for the temporary assignments created for each field of an aggregate we are constructing. Using this new variant, we can emit a message mentioning "this usage", emphasizing the fact that the error message is related to the specific use site (in the struct expression). This is preparation for additional work on improving NLL error messages (see #57374)
2021-09-16Auto merge of #88979 - tmiasko:no-remove-zsts-in-generators, r=oli-obkbors-0/+16
Disable RemoveZsts in generators to avoid query cycles Querying layout of a generator requires its optimized MIR. Thus computing layout during MIR optimization of a generator might create a query cycle. Disable RemoveZsts in generators to avoid the issue (similar approach is used in ConstProp transform already). Fixes #88972.
2021-09-16fix rebaseEsteban Kuber-0/+18
2021-09-16Auto merge of #88219 - jyn514:parallel-io, r=GuillaumeGomezbors-45/+53
rustdoc: reduce number of copies when using parallel IO This is Windows-only for now; I was getting really bad slowdowns from this on linux for some reason. Helps with https://github.com/rust-lang/rust/issues/82741. Follow-up to https://github.com/rust-lang/rust/pull/60971.
2021-09-16Point at argument when evaluating `Path`'s boundsEsteban Kuber-46/+10
When evaluating an `ExprKind::Call`, we first have to `check_expr` on it's callee. When this one is a `ExprKind::Path`, we had to evaluate the bounds introduced for its arguments, but by the time we evaluated them we no longer had access to the argument spans. Now we special case this so that we can point at the right place on unsatisfied bounds. This also allows the E0277 deduplication to kick in correctly, so we now emit fewer errors.
2021-09-16Fix rebaseEsteban Kuber-3/+12
2021-09-16Remove unnecessary labelEsteban Kuber-28/+7
2021-09-16fix rebaseEsteban Kuber-1/+3
2021-09-16Point at call span that introduced obligation for the argEsteban Kuber-249/+657
2021-09-16Refactor `FulfillmentError` to track less dataEsteban Kuber-3/+3
Move the information about pointing at the call argument expression in an unmet obligation span from the `FulfillmentError` to a new `ObligationCauseCode`.
2021-09-16Point at argument instead of call for their obligationsEsteban Kuber-47/+22
When an obligation is introduced by a specific `fn` argument, point at the argument instead of the `fn` call if the obligation fails to be fulfilled.
2021-09-16Enable rustdoc's --generate-link-to-definition for rustc docsGiacomo Stevanato-0/+1
2021-09-16Auto merge of #86809 - DevinR528:reachable-pat, r=Nadrierilbors-5/+340
Add non_exhaustive_omitted_patterns lint related to rfc-2008-non_exhaustive Fixes: #84332 This PR adds `non_exhaustive_omitted_patterns`, an allow by default lint that is triggered when a `non_exhaustive` type is missing explicit patterns. The warning or deny attribute can be put above the wildcard `_` pattern on enums or on the expression for enums or structs. The lint is capable of warning about multiple types within the same pattern. This lint will not be triggered for `if let ..` patterns. ```rust // crate A #[non_exhaustive] pub struct Foo { a: u8, b: usize, } #[non_exhaustive] pub enum Bar { A(Foo), B, } // crate B #[deny(non_exhaustive_omitted_patterns)] // here match Bar::B { Bar::B => {} #[deny(non_exhaustive_omitted_patterns)] // or here _ => {} } #[warn(non_exhaustive_omitted_patterns)] // only here let Foo { a, .. } = Foo::default(); #[deny(non_exhaustive_omitted_patterns)] match Bar::B { // triggers for Bar::B, and Foo.b Bar::A(Foo { a, .. }) => {} // if the attribute was here only Bar::B would cause a warning _ => {} } ```
2021-09-16Fix clippyjackh726-3/+3
2021-09-15Fix rustdocjackh726-2/+6
2021-09-16Fix shuffle index constant not being monomorphized.Caleb Zulawski-0/+40
2021-09-16Auto merge of #88992 - Manishearth:rollup-k9hijii, r=Manishearthbors-460/+181
Rollup of 8 pull requests Successful merges: - #87320 (Introduce -Z remap-cwd-prefix switch) - #88690 (Accept `m!{ .. }.method()` and `m!{ .. }?` statements. ) - #88775 (Revert anon union parsing) - #88841 (feat(rustc_typeck): suggest removing bad parens in `(recv.method)()`) - #88907 (Highlight the `const fn` if error happened because of a bound on the impl block) - #88915 (`Wrapping<T>` has the same layout and ABI as `T`) - #88933 (Remove implementation of `min_align_of` intrinsic) - #88951 (Update books) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-09-15Fix linting when trailing macro expands to a trailing semiAaron Hill-0/+34
When a macro is used in the trailing expression position of a block (e.g. `fn foo() { my_macro!() }`), we currently parse it as an expression, rather than a statement. As a result, we ended up using the `NodeId` of the containing statement as our `lint_node_id`, even though we don't normally do this for macro calls. If such a macro expands to an expression with a `#[cfg]` attribute, then the trailing statement can get removed entirely. This lead to an ICE, since we were usng the `NodeId` of the expression to emit a lint. Ths commit makes us skip updating `lint_node_id` when handling a macro in trailing expression position. This will cause us to lint at the closest parent of the macro call.
2021-09-15Disable debuginfo test on Windows that fails in new cdb version.Eric Huss-0/+2
2021-09-15Rollup merge of #88951 - ehuss:update-books, r=ehussManish Goregaokar-0/+0
Update books ## rust-by-example 1 commits in 04f489c889235fe3b6dfe678ae5410d07deda958..9d4132b56c4999cd3ce1aeca5f1b2f2cb0d11c24 2021-08-17 08:01:20 -0300 to 2021-09-14 06:56:00 -0300 - Fix link to "integration testing" page (rust-lang/rust-by-example#1458) ## rustc-dev-guide 17 commits in 95f1acf9a39d6f402f654e917e2c1dfdb779c5fc..9198465b6ca8bed669df0cbb67c0e6d0b140803c 2021-08-31 12:38:30 -0500 to 2021-09-12 11:50:44 -0500 - Clarify difference of a help vs note diagnostic. - remove ctag section - Update suggested.md - Update SUMMARY.md - Move ctag section to "Suggested Workflow" - Delete ctags.md - Clarify paragraph in "Keeping things up to date" - Docs: added section on rustdoc - Docs: made suggested fix - Docs: deleted copy - Docs: added section discussing core ideas - Docs: delete redundant use of correctness - Docs: consolidated parallelism information - Add links to overview.md (rust-lang/rustc-dev-guide#1202) - Spelling change intermidiate to intermediate - Fix a typo (rust-lang/rustc-dev-guide#1200) - Documenting diagnostic items with their usage and naming conventions (rust-lang/rustc-dev-guide#1192) ## embedded-book 1 commits in c3a51e23859554369e6bbb5128dcef0e4f159fb5..4c76da9ddb4650203c129fceffdea95a3466c205 2021-08-26 07:04:58 +0000 to 2021-09-12 12:43:03 +0000 - 2.1(QEMU): update app name for git project init (rust-embedded/book#301)