about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-04-04Rollup merge of #109896 - ↵Yuki Okushi-0/+10
Nilstrieb:integers-are-not-fn-ptrs-remember-this-dear-transmuter, r=compiler-errors Never consider int and float vars for `FnPtr` candidates This solves a regression where `0.0.cmp()` was ambiguous when a custom trait with a `cmp` method was in scope. For integers it shouldn't be a problem in practice so I wasn't able to add a test. I'm not sure whether there could be more issues hidden in the shadows as mentioned in the issue, but this should at least fix the problematic regression immediately. fixes #109892 r? oli-obk
2023-04-03Never consider int and float vars for `FnPtr` candidatesNilstrieb-0/+10
This solves a regression where `0.0.cmp()` was ambiguous when a custom trait with a `cmp` method was in scope. FOr integers it shouldn't be a problem in practice so I wasn't able to add a test.
2023-04-03Rollup merge of #109873 - jyn514:subdirectories, r=compiler-errorsMatthias Krüger-0/+0
Move some UI tests into subdirectories
2023-04-03Rollup merge of #109856 - bvanjoi:fix-issue-109304, r=compiler-errorsMatthias Krüger-76/+5
fix(middle): emit error rather than delay bug when reaching limit close #109304
2023-04-03fix(middle): emit error rather than delay bug when reaching limitbohan-76/+5
2023-04-03Auto merge of #109770 - jyn514:run-make-fulldeps, r=Mark-Simulacrumbors-95/+226
Move almost all run-make-fulldeps tests to run-make They pass fine, and this avoids having to build the compiler twice. There are few enough tests left that I think it should be possible to get rid of this test suite altogether, but I expect this PR to fail at least a few times in bors and want to get it merged before tackling further changes. cc https://github.com/rust-lang/rust/pull/83775 Fixes https://github.com/rust-lang/rust/issues/66085. Fixes https://github.com/rust-lang/rust/issues/83773.
2023-04-02Move some UI tests into subdirectoriesjyn-0/+0
to avoid going over the existing limit now that the ui-fulldeps tests have been moved to ui.
2023-04-02try to fix test-variousjyn-1/+4
2023-04-02Auto merge of #109008 - clubby789:drop-elaborate-array, r=davidtwcobors-0/+16
Drop array patterns using subslices Fixes #109004 Drops contiguous subslices of an array when moving elements out with a pattern, which improves perf for large arrays r? `@compiler-errors`
2023-04-01Fix `non_exhaustive_omitted_patterns` on argumentsclubby789-1/+32
2023-04-01Auto merge of #109801 - aliemjay:test-implied-normalization, r=petrochenkovbors-0/+57
add test for normalization in implied bounds query See https://github.com/rust-lang/rust/issues/109799.
2023-03-31Auto merge of #109165 - aliemjay:fix-ice-annotation, r=davidtwcobors-0/+40
allow ReError in CanonicalUserTypeAnnotation Why not? we already allow `TyKind::Error`. Fixes #109072.
2023-03-31Auto merge of #109824 - GuillaumeGomez:rollup-i5r4uts, r=GuillaumeGomezbors-113/+607
Rollup of 7 pull requests Successful merges: - #109104 (rustdoc: Fix invalid suggestions on ambiguous intra doc links v2) - #109443 (Move `doc(primitive)` future incompat warning to `invalid_doc_attributes`) - #109680 (Fix subslice capture in closure) - #109798 (fluent_messages macro: don't emit the OS error in a note) - #109805 (Source map cleanups) - #109818 (rustdoc: Add GUI test for jump to collapsed item) - #109820 (rustdoc-search: update docs for comma in `?` help popover) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-31Rollup merge of #109818 - GuillaumeGomez:test-collapsed-item, r=notriddleGuillaume Gomez-0/+21
rustdoc: Add GUI test for jump to collapsed item Part of https://github.com/rust-lang/rust/issues/66181. I updated `browser-ui-test` version because I needed to add a new command `property`: https://github.com/GuillaumeGomez/browser-UI-test/pull/452. r? `@notriddle`
2023-03-31Rollup merge of #109798 - est31:ftl_test_note, r=davidtwcoGuillaume Gomez-10/+6
fluent_messages macro: don't emit the OS error in a note This makes it possible to make the normalization of the error message precise, allowing us to not normalize all notes away. See https://github.com/rust-lang/rust/pull/109700#discussion_r1152489053
2023-03-31Rollup merge of #109680 - clubby789:array-subslice-2229, r=davidtwcoGuillaume Gomez-0/+39
Fix subslice capture in closure Fixes #109298 by refining captures in the same way for Subslices and Indexes. The comment `// we never capture this` seems to have been inaccurate, as changing it to an assert causes many test failures `@rustbot` label +A-closures
2023-03-31Rollup merge of #109443 - GuillaumeGomez:doc-primitive-hard-error, r=notriddleGuillaume Gomez-56/+81
Move `doc(primitive)` future incompat warning to `invalid_doc_attributes` Fixes #88070. It's been a while since this was turned into a "future incompatible lint" so I think we can now turn it into a hard error without problem. r? `@jyn514`
2023-03-31Rollup merge of #109104 - ↵Guillaume Gomez-47/+460
GuillaumeGomez:fix-invalid-suggestion-ambiguous-intra-doc2, r=oli-obk,notriddle rustdoc: Fix invalid suggestions on ambiguous intra doc links v2 Fixes https://github.com/rust-lang/rust/issues/108653. This is another approach to fixing the same issue. This time, we keep the computed information around instead of re-computing it. Strangely enough, the order for ambiguities seem to have been changed. Not an issue but it creates a lot of diff... So which version do you prefer? r? `@notriddle`
2023-03-31Auto merge of #109010 - compiler-errors:rtn, r=eholkbors-0/+311
Initial support for return type notation (RTN) See: https://smallcultfollowing.com/babysteps/blog/2023/02/13/return-type-notation-send-bounds-part-2/ 1. Only supports `T: Trait<method(): Send>` style bounds, not `<T as Trait>::method(): Send`. Checking validity and injecting an implicit binder for all of the late-bound method generics is harder to do for the latter. * I'd add this in a follow-up. 3. ~Doesn't support RTN in general type position, i.e. no `let x: <T as Trait>::method() = ...`~ * I don't think we actually want this. 5. Doesn't add syntax for "eliding" the function args -- i.e. for now, we write `method(): Send` instead of `method(..): Send`. * May be a hazard if we try to add it in the future. I'll probably add it in a follow-up later, with a structured suggestion to change `method()` to `method(..)` once we add it. 7. ~I'm not in love with the feature gate name 😺~ * I renamed it to `return_type_notation` :heavy_check_mark: Follow-up PRs will probably add support for `where T::method(): Send` bounds. I'm not sure if we ever want to support return-type-notation in arbitrary type positions. I may also make the bounds require `..` in the args list later. r? `@ghost`
2023-03-31allow ReError in CanonicalUserTypeAnnotationAli MJ Al-Nasrawy-0/+40
2023-03-31Add tests to check that collapsed content is expanded when jumping to itGuillaume Gomez-0/+21
2023-03-31Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obkbors-8/+26
Insert alignment checks for pointer dereferences when debug assertions are enabled Closes https://github.com/rust-lang/rust/issues/54915 - [x] Jake tells me this sounds like a place to use `MirPatch`, but I can't figure out how to insert a new basic block with a new terminator in the middle of an existing basic block, using `MirPatch`. (if nobody else backs up this point I'm checking this as "not actually a good idea" because the code looks pretty clean to me after rearranging it a bit) - [x] Using `CastKind::PointerExposeAddress` is definitely wrong, we don't want to expose. Calling a function to get the pointer address seems quite excessive. ~I'll see if I can add a new `CastKind`.~ `CastKind::Transmute` to the rescue! - [x] Implement a more helpful panic message like slice bounds checking. r? `@oli-obk`
2023-03-30Disable the ui panic test on wasm32-bareBen Kimock-0/+1
2023-03-31add test for normalization in implied bounds queryAli MJ Al-Nasrawy-0/+57
See https://github.com/rust-lang/rust/issues/109799.
2023-03-31Don't emit the OS error in a noteest31-10/+6
This makes it possible to make the normalization of the error message more precise, allowing us to not normalize all notes away.
2023-03-30Auto merge of #109791 - compiler-errors:rollup-c3o710k, r=compiler-errorsbors-24/+67
Rollup of 6 pull requests Successful merges: - #109347 (Skip no_mangle if the item has no name.) - #109522 (Implement current_dll_path for AIX) - #109679 (Freshen normalizes-to hack goal RHS in the evaluate loop) - #109704 (resolve: Minor improvements to effective visibilities) - #109739 (Closures always implement `FnOnce` in new solver) - #109758 (Parallel compiler cleanups) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-30Add test to ensure doc(primitive) is not recognized anymoreGuillaume Gomez-0/+24
2023-03-30Update tests for rustc_doc_primitiveGuillaume Gomez-56/+57
2023-03-30Rollup merge of #109739 - compiler-errors:new-solver-closure-fnonce, r=lcnrMichael Goulet-0/+11
Closures always implement `FnOnce` in new solver We should process `[closure]: FnOnce(Tys...) -> Ty` obligations *before* fallback and closure analysis. We can do this by taking advantage of the fact that `FnOnce` is always implemented by closures, even before we definitely know the closure kind. Fixes compiler-errors/next-solver-hir-issues#15 r? ``@oli-obk`` (trying to spread the reviewer load for new trait solver prs, and this one is pretty self-contained, though feel free to reassign 😸)
2023-03-30Rollup merge of #109704 - petrochenkov:effvisclean, r=jackh726Michael Goulet-24/+37
resolve: Minor improvements to effective visibilities See individual commits.
2023-03-30Rollup merge of #109347 - cjgillot:issue-109305, r=WaffleLapkinMichael Goulet-0/+19
Skip no_mangle if the item has no name. Fixes https://github.com/rust-lang/rust/issues/109305
2023-03-30Auto merge of #109740 - ↵bors-0/+37
compiler-errors:new-solver-deep-reject-placeholder-consts, r=lcnr Don't ICE on placeholder consts in deep reject Since we canonicalize const params into placeholder consts, we need to be able to handle them during deep reject. r? `@lcnr` (though maybe `@oli-obk` can look at this one too, if he wants 😸) Fixes compiler-errors/next-solver-hir-issues#10
2023-03-30Auto merge of #108576 - ↵bors-29/+480
megakorre:rustdock_additional_typecheck_before_clean, r=GuillaumeGomez rustdoc: run more HIR validation to mirror rustc # Explanation While investigating these issues: https://github.com/rust-lang/rust/issues/107093, https://github.com/rust-lang/rust/issues/106079 I thought it maybe would be useful to test running `rustdoc` on all rust files under `tests/ui` grepping for files that causes any ICEs. And these are the files I found would cause ICEs. ``` // These are handled by this fix. tests/ui/late-bound-lifetimes/mismatched_arg_count.rs tests/ui/associated-consts/issue-102335-const.rs tests/ui/const-generics/generic_const_exprs/issue-102768.rs tests/ui/const-generics/const-arg-type-arg-misordered.rs tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs tests/ui/typeck/issue-88643.rs tests/ui/typeck/issue-75889.rs tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs // These are not they will still produce a ICE after this change tests/ui/limits/issue-56762.rs tests/ui/union/projection-as-union-type-error-2.rs tests/ui/union/projection-as-union-type-error.rs ``` I reduces the issues handled by this PR down to the tests added in the PR. That includes the linked issues. But the 3 files that are not handled I will leave for a future PR. This PR adds the `type_collecting` step from `hir_analysis::check_crate` to the rustdoc typechecks. It had the following comment on it. ``` // this ensures that later parts of type checking can assume that items // have valid types and not error ``` Adding the check report the same errors as rustc does for these input. And not ICE when the lint checker walks the HIR or when in the `rustdoc::clean` pass. This PR updates the expected errors of some existing rustdoc-ui tests (some now report less errors). These new reported errors does mirror the errors reported by rustc. # Performance It does more checking so it will probably regress. We should run ``@bors` try `@rust-timer` queue` and see. # Discussion Maybe instead of calling a subset of the checks in `hir_analysis::check_crate` and having comments that say they should be kept in sync. We could instead call `check_crate` directly and pass in some flag. Maybe `check_toplevel_signatures_only` or something like that. That flag would have to skip most of the checks in that function tough.
2023-03-30Closures always implement FnOnce in new solverMichael Goulet-0/+11
2023-03-30rustdoc: tidy excess whitespacePatrik Kårlin-4/+4
2023-03-30ignore failing cross-compiled run-make testsJoshua Nelson-0/+127
`run-make-fulldeps` is never cross-compiled, so a lot of these tests never accounted for --target. Ignore them when cross-compiling for now.
2023-03-30fix `sysroot-crates-are-unstable` for cross-compilationJoshua Nelson-0/+1
2023-03-30move `tools.mk` to run-makeJoshua Nelson-88/+88
apparently I missed some tests in the last commit. Rather than having dozens of tests use the long version, use the short version in `run-make` and the long version in `run-make-fulldeps` (which is now only three tests)
2023-03-30rustdoc: add error messages to the testPatrik Kårlin-60/+74
2023-03-30rustdoc: remove other redundant itemPatrik Kårlin-11/+0
2023-03-30rustdoc: remove excess from rustdoc testPatrik Kårlin-6/+2
2023-03-30rustdoc: remove redundant testPatrik Kårlin-13/+0
2023-03-30rustdoc: update with --bless and change expected errorsPatrik Kårlin-30/+352
2023-03-30rustdoc: run more HIR validation to mirror rustcPatrik Kårlin-0/+143
2023-03-30Auto merge of #109769 - JohnTitor:rollup-7n2bnpg, r=JohnTitorbors-10/+59
Rollup of 7 pull requests Successful merges: - #106985 (Enhanced doucmentation of binary search methods for `slice` and `VecDeque` for unsorted instances) - #109509 (compiletest: Don't allow tests with overlapping prefix names) - #109719 (RELEASES: Add "Only support Android NDK 25 or newer" to 1.68.0) - #109748 (Don't ICE on `DiscriminantKind` projection in new solver) - #109749 (Canonicalize float var as float in new solver) - #109761 (Drop binutils on powerpc-unknown-freebsd) - #109766 (Fix title for openharmony.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-30fix wrong includesJoshua Nelson-7/+7
2023-03-30Move almost all run-make-fulldeps to run-makeJoshua Nelson-2/+2
They pass fine.
2023-03-30Rollup merge of #109749 - compiler-errors:new-solver-float-var, r=lcnrYuki Okushi-0/+8
Canonicalize float var as float in new solver Typo in new canonicalizer -- we should be canonicalizing float vars as `CanonicalTyVarKind::Float`, not `CanonicalTyVarKind::Int`. Fixes compiler-errors/next-solver-hir-issues#9
2023-03-30Rollup merge of #109748 - compiler-errors:new-solver-discr-kind-ice, r=lcnrYuki Okushi-10/+51
Don't ICE on `DiscriminantKind` projection in new solver As title says, since we now actually call `Ty::discriminant_kind` on placeholder types 😃 Also drive-by simplify `Pointee::Metadata` projection logic, and fix the UI test because the `<T as Pointee>::Metadata` tests weren't actually exercising the new projection logic, since we still eagerly normalize (which hits `project.rs` in the old solver) in HIR typeck. r? `@lcnr` tho feel free to re-roll, this pr is very low-priority and not super specific to the new trait solver. Fixes compiler-errors/next-solver-hir-issues#14
2023-03-30Rollup merge of #109509 - ehuss:overlapping-tests, r=Mark-SimulacrumYuki Okushi-0/+0
compiletest: Don't allow tests with overlapping prefix names Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path, or otherwise clash with it while the two tests are trying to create/delete/modify the same directory. In practice, this manifested as a random error on macOS where two tests were trying to create/delete/create `rustdoc/primitive` and `rustdoc/primitive/no_std`, which resulted in an EINVAL (InvalidInput) error. This renames some of the offending tests, adds `compiletest-ignore-dir` to prevent compiletest from processing some files, and adds a check to prevent this from happening in the future. Fixes #109397