about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-01-06Auto merge of #80714 - jakevossen5:master, r=lcnrbors-54/+54
fixed const_generics error help Closes https://github.com/rust-lang/rust/issues/80702
2021-01-06Auto merge of #80724 - GuillaumeGomez:remove-useless-doc_alias-feature, r=jyn514bors-23/+17
Remove useless doc_alias feature gate As `@jyn514` rightfully noted in https://github.com/rust-lang/rust/pull/80686 , this feature is no more. Therefore, cleanup time! r? `@jyn514`
2021-01-05Add rustdoc test.Camille GILLOT-0/+14
2021-01-05Remove useless doc_alias featureGuillaume Gomez-23/+17
2021-01-05Auto merge of #80686 - GuillaumeGomez:error-doc-alias-same-name, r=jyn514bors-0/+24
Error when #[doc(alias)] has same name as the item Something I came across when reviewing some doc alias PRs. r? `@jyn514`
2021-01-05fixed feature gate stderrJake Vossen-1/+1
2021-01-05fixed const_generics error helpJake Vossen-53/+53
2021-01-05Rollup merge of #80696 - RalfJung:failing-promoteds, r=oli-obkYuki Okushi-2/+13
make sure that promoteds which fail to evaluate in dead const code behave correctly https://github.com/rust-lang/rust/pull/80243 showed that we'll have to live with these kinds of failing promoteds for a while, so let's make sure we have a test that covers them.
2021-01-05Rollup merge of #80538 - JulianKnodt:err_usize, r=lcnrYuki Okushi-0/+25
Add check for `[T;N]`/`usize` mismatch in astconv Helps clarify the issue in #80506 by adding a specific check for mismatches between [T;N] and usize. r? `@lcnr`
2021-01-04make sure that promoteds which fail to evaluate in dead const code behave ↵Ralf Jung-2/+13
correctly
2021-01-04Add tests for new doc alias checkGuillaume Gomez-0/+24
2021-01-04Auto merge of #80651 - GroteGnoom:issue-78123-fix, r=Nadrierilbors-0/+29
Add note to non-exhaustive match on reference to empty Rust prints "type `&A` is non-empty" even is A is empty. This is the intended behavior, but can be confusing. This commit adds a note to non-exhaustive pattern errors if they are a reference to something uninhabited. I did not add tests to check that the note is not shown for non-references or inhabited references, because this is already done in other tests. Maybe the added test is superfluous, because `always-inhabited-union-ref` already checks for this case. This does not handle &&Void or &&&void etc. I could add those as special cases as well and ignore people who need quadruple references. Fixes #78123
2021-01-04Auto merge of #80661 - jyn514:duplicate-types, r=GuillaumeGomezbors-3/+16
Cleanup rustdoc handling of associated types This is best reviewed a commit at a time. No particular reason for these changes, they just stood out as I was reviewing https://github.com/rust-lang/rust/pull/80653 and thinking about https://github.com/rust-lang/rust/issues/80379. The new test case worked before, it just wasn't tested. r? `@GuillaumeGomez`
2021-01-04Add check for array/usize mismatch in astconvkadmin-0/+25
2021-01-04Auto merge of #80418 - oli-obk:this_could_have_been_so_simple, r=RalfJungbors-55/+126
Allow references to interior mutable data behind a feature gate supercedes #80373 by simply not checking for interior mutability on borrows of locals that have `StorageDead` and thus can never be leaked to the final value of the constant tracking issue: https://github.com/rust-lang/rust/issues/80384 r? `@RalfJung`
2021-01-03Simplify rustdoc handling of type aliases for associated typesJoshua Nelson-3/+16
The logic was very hard to follow before.
2021-01-03Auto merge of #77859 - bugadani:no-duplicate-ref-link-error, r=jyn514bors-8/+84
Rustdoc: only report broken ref-style links once This PR assigns the markdown `LinkType` to each parsed link and passes this information into the link collector. If a link can't be resolved in `resolve_with_disambiguator`, the failure is cached for the link types where we only want to report the error once (namely `Shortcut` and `Reference`). Fixes #77681
2021-01-03Add notes to stderr of non-exhaustive-reference testDaniel Noom-2/+6
2021-01-03Add note on void reference testDaniel Noom-0/+1
This test is also changed by adding a note about uninhabited references still counting as inhabited.
2021-01-03Add note to non-exhaustive match on reference to emptyDaniel Noom-0/+24
Rust prints "type `&A` is non-empty" even is A is empty. This is the intended behavior, but can be confusing. This commit adds a note to non-exhaustive pattern errors if they are a reference to something uninhabited. I did not add tests to check that the note is not shown for non-references or inhabited references, because this is already done in other tests. Maybe the added test is superfluous, because `always-inhabited-union-ref` already checks for this case. This does not handle &&Void or &&&void etc. I could add those as special cases as well and ignore people who need quadruple references. Fixes #78123
2021-01-03Only report reference-style link errors onceDániel Buga-8/+84
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-01-03Rollup merge of #80580 - GuillaumeGomez:suggestion-ignore-codeblock-warn, ↵Guillaume Gomez-0/+24
r=jyn514 Add suggestion for "ignore" doc code block Part of https://github.com/rust-lang/rust/issues/30032. This PR adds a suggestion to help users when they have a "ignore" doc code block which is invalid rust code. r? `@jyn514`
2021-01-03Stylistic fixes to diagnostic messagesoli-1/+1
2021-01-03Refactor the non-transient cell borrow error diagnosticoli-22/+24
2021-01-03Update now-more-precise operation with a preciser messageoli-14/+14
2021-01-03Auto merge of #80261 - GuillaumeGomez:attr-rework, r=jyn514bors-2/+4
rustdoc DocFragment rework Kind of a follow-up of #80119. A few things are happening in this PR. I'm not sure about the impact on perf though so I'm very interested about that too (if the perf is worse, then we can just close this PR). The idea here is mostly about reducing the memory usage by relying even more on `Symbol` instead of `String`. The only issue is that `DocFragment` has 3 modifications performed on it: 1. Unindenting 2. Collapsing similar comments into one 3. "Beautifying" (weird JS-like comments handling). To do so, I saved the information about unindent and the "collapse" is now on-demand (which is why I'm not sure the perf will be better, it has to be run multiple times...). r? `@jyn514`
2021-01-02Auto merge of #80592 - Skynoodle:snake-case-lint-reserved-identifier, ↵bors-0/+86
r=davidtwco Suggest renaming or escaping when fixing non-snake-case identifiers which would conflict with keywords Fixes #80575
2021-01-02Update rustdoc-ui test outputGuillaume Gomez-2/+4
2021-01-02Add snake case lint note about keyword identifiers which cannot be rawSkynoodle-0/+2
2021-01-02Rollup merge of #80613 - bugadani:issue-80607, r=matthewjasperMara Bos-0/+24
Diag: print enum variant instead of enum type Closes #80607
2021-01-02Print actual enum variantDániel Buga-3/+3
2021-01-02Add test for #80607 with undesired outputDániel Buga-0/+24
2021-01-02Auto merge of #79883 - frewsxcv:frewsxcv-san, r=shepmasterbors-2/+2
Enable ASan, TSan, UBSan for aarch64-apple-darwin. I confirmed ASan, TSan, UBSan all work for me locally with `clang` on my new Macbook Air. ~This requires https://github.com/rust-lang/llvm-project/pull/86~
2021-01-01Bless ui testsoli-2/+2
2021-01-01Add reserved identifier test cases for snake case lintSkynoodle-0/+84
2021-01-01Reinstate the error-code error over the feature gate erroroli-18/+8
2021-01-01Enhance some commentsoli-9/+14
2021-01-01Fix cell checks in const fnoli-0/+2
2021-01-01Allow references to interior mutable data behind a feature gateoli-38/+110
2021-01-01Auto merge of #80565 - camelid:fix-not-has, r=GuillaumeGomezbors-3/+3
Fix tests that incorrectly used `!@has` instead of `@!has` The command is ``@!has`,` not `!`@has`.` I don't think these checks were doing anything before! Ideally we would accept `!`@has`` as well, or at least fail tests that use `!`@has`.` The current behavior seems to be silently ignoring the check, which is very confusing. r? `@GuillaumeGomez`
2021-01-01Add test for suggestion in case a "ignore" doc block has invalid rust code ↵Guillaume Gomez-0/+24
inside
2021-01-01Auto merge of #80547 - lqd:const_generics_defaults, r=varkorbors-7/+45
In which we start to parse const generics defaults As discussed in this [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const.20generic.20defaults), this PR extracts the parsing parts from `@JulianKnodt's` PR #75384 for a better user-experience using the newly stabilized `min_const_generics` (albeit temporary) as shown in #80507: trying to use default values on const generics currently results in parse errors, as if the user didn't use the correct syntax (which is somewhat true but also misleading). This PR extracts (and slightly modifies in a couple places) `@JulianKnodt's` parsing code (with attribution if I've done everything correctly), AST and HIR changes, and feature gate setup. This feature is now marked as "incomplete" and thus will also print out the expected "const generics default values are unstable" error instead of a syntax error. Note that, as I've only extracted the parsing part, the actual feature will not work at all if enabled. There will be ICEs, and inference errors on the const generics default values themselves. Fixes #80507. Once this merges, I'll: - modify the const generics tracking issue to refer to the `const_generics_defaults` gate rather than the older temporary name it uses there. - create the GH `F-const_generics_defaults` label r? `@varkor`
2021-01-01make `const_generics_defaults` use the unstable syntax mechanismRémy Rakic-18/+27
This is important to not accidentally stabilize the parsing of the syntax while it still is experimental and not formally accepted
2021-01-01adjust const generics defaults FIXMEs to the new feature gateRémy Rakic-1/+1
2021-01-01update `min_const_generics` tests using default values for const paramsRémy Rakic-8/+12
The `const_generics_defaults` now handles them, and they correctly parse, so we can update these tests expecting a parser error .
2021-01-01add test for the `const_generics_defaults` feature gateRémy Rakic-0/+25
2021-01-01Auto merge of #80539 - JohnTitor:ui-test-root-cleanup, r=petrochenkovbors-27/+19
Reduce the entry on `src/test/ui` (UI test root) CC #73494, similar to #79776. r? `@petrochenkov`
2020-12-31Merge remote-tracking branch 'origin/master' into frewsxcv-sanCorey Farwell-5218/+6605
2021-01-01Auto merge of #79576 - m-ou-se:2021, r=Mark-Simulacrumbors-42/+49
Add edition 2021. :fireworks: Happy new ~~year~~ Rust. :champagne: This adds --edition=2021, and updates suggestions about 2018 to say "2018 *or later*". Related Cargo PR: https://github.com/rust-lang/cargo/pull/8922 --- Edit: This adds the new edition as *unstable*. Without `-Z unstable-options`, `--edition=2021` results in: ``` $ rustc --edition=2021 error: edition 2021 is unstable and only available with -Z unstable-options. ```
2021-01-01Move feature gate-related testsYuki Okushi-0/+0