Commit Graph

1779 Commits

Author SHA1 Message Date
Thom Chiovoloni
46fad955c0 Fix a debuginfo test with a hard-coded hash 2023-04-05 15:59:29 +00:00
Thom Chiovoloni
476737e03c Fix an assembly test with a hard-coded hash 2023-04-05 15:59:29 +00:00
Thom Chiovoloni
36ca32c1ed Fix a codegen test with some hard-coded hashes 2023-04-05 15:59:29 +00:00
Thom Chiovoloni
0db1f54f89 Bless tests 2023-04-05 15:59:29 +00:00
Yuki Okushi
b8e90766b5
Add regression test for #86351
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-05 22:47:33 +09:00
Yuki Okushi
2df3f490dd
Add regression test for #80409
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-05 21:20:07 +09:00
Yuki Okushi
038ece0a42
Rollup merge of #109956 - compiler-errors:tweak-debug-outputs, r=oli-obk
Tweak debug outputs to make debugging new solver easier

1. Move the fields that are "most important" (I know this is subjective) to the beginning of the structs.

For goals, I typically care more about the predicate than the param-env (which is significantly longer in debug output).
For canonicalized things, I typically care more about what is *being* canonicalized.
For a canonical response, I typically care about the response -- or at least, it's typically useful to put it first since it's short and affects the whether the solver recurses or not...

2. Add some more debug and instrument calls to functions to add more structure to tracing lines.

r? `@oli-obk` or `@BoxyUwU` (since I think `@lcnr` is on holiday)
2023-04-05 20:47:24 +09:00
Yuki Okushi
ee63b65007
Rollup merge of #109932 - GuillaumeGomez:source-code-scrollbar, r=notriddle
Source code scrollbar

Fixes https://github.com/rust-lang/rust/issues/109865.

You can test it [here](https://rustdoc.crud.net/imperio/source-code-scrollbar/src/test_docs/lib.rs.html).

It seems to introduce a few regressions (at least change of behaviour) about the scroll "saving" though.

r? `@notriddle`
2023-04-05 20:47:23 +09:00
bors
8d321f7a88 Auto merge of #109843 - scottmcm:better-transmute, r=WaffleLapkin
Allow `transmute`s to produce `OperandValue`s instead of needing `alloca`s

LLVM can usually optimize these away, but especially for things like transmutes of newtypes it's silly to generate the `alloc`+`store`+`load` at all when it's actually a nop at LLVM level.
2023-04-05 03:26:38 +00:00
Michael Goulet
786fc90855 Tweak debug outputs to make debugging new solver easier 2023-04-05 03:18:29 +00:00
Michael Goulet
4a4fc3bb5b Implement support for GeneratorWitnessMIR in new solver 2023-04-05 03:04:54 +00:00
Scott McMurray
9aa9a846b6 Allow transmutes to produce OperandValues instead of always using allocas
LLVM can usually optimize these away, but especially for things like transmutes of newtypes it's silly to generate the `alloc`+`store`+`load` at all when it's actually a nop at LLVM level.
2023-04-04 18:44:29 -07:00
bors
603270011e Auto merge of #109944 - cjgillot:lint-cstring-macro, r=Nilstrieb
Do not suppress temporary_cstring_as_ptr in macros.

There isn't really a reason to skip the lint when part of the expression comes from an expansion.

Fixes https://github.com/rust-lang/rust/issues/94694
2023-04-04 22:35:09 +00:00
bors
700938c078 Auto merge of #109808 - jyn514:debuginfo-options, r=michaelwoerister
Extend -Cdebuginfo with new options and named aliases

This is a rebase of https://github.com/rust-lang/rust/pull/83947, along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F). The description for the original PR follows below.

Note that the changes in this PR have already been through FCP: https://github.com/rust-lang/rust/pull/83947#issuecomment-878384979

Closes https://github.com/rust-lang/rust/pull/109311. Helps with https://github.com/rust-lang/rust/pull/104968.
r? `@michaelwoerister` cc `@cuviper`

---

The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options.

Fix https://github.com/rust-lang/rust/issues/60020
Fix https://github.com/rust-lang/rust/issues/64405
2023-04-04 20:01:05 +00:00
Camille GILLOT
8528ac6e35 Do not suppress temporary_cstring_as_ptr in macros. 2023-04-04 18:55:02 +00:00
Michael Goulet
678d7c505d
Rollup merge of #109940 - JohnTitor:issue-93911, r=compiler-errors
Add regression test for #93911

r? `@compiler-errors`
Closes #93911
2023-04-04 09:27:48 -07:00
Michael Goulet
b0483e8004
Rollup merge of #109938 - oli-obk:try_norm, r=compiler-errors
Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible

fixes #109743

This hack didn't need to live in the mir interpreter. For const-prop-lint it is entirely correct to avoid doing any const prop if normalization fails at this stage. Most likely we couldn't const propagate anything anyway, and if revealing was needed (so opaque types were involved), we wouldn't want to be too smart and leak the hidden type anyway.
2023-04-04 09:27:47 -07:00
Michael Goulet
d984671246
Rollup merge of #109937 - compiler-errors:rustdoc-rpit-cant-be-documented, r=GuillaumeGomez
Don't collect return-position impl traits for documentation

#104889 modified the rustdoc ast collection step to use a HIR visitor, which more thoroughly walks the HIR tree. that means that we're going to encounter inner items (incl return-position impl traits and async fn opaque futures) that are not possible to document.

FIxes (but does not close due to being a beta regression) #109931

r? `@GuillaumeGomez`
2023-04-04 09:27:47 -07:00
Michael Goulet
72e535ea99
Rollup merge of #109919 - fmease:rustdoc-fix-issue-109488, r=notriddle
rustdoc: escape GAT args in more cases

Fixes #109488.

Previously we printed the *un*escaped form of GAT arguments not only when `f.alternate()` was true but *also* when we failed to compute the URL of the trait associated with the type projection, i.e. when `href(…)` returned an `Err(_)`.

In this PR the argument printing logic is entirely separate from the link resolution code above as it should be.
Further, we now only try to compute the URL if the HTML format was requested with `!f.alternate()`. Before, we would sometimes compute the `href` only to throw it away later.
2023-04-04 09:27:46 -07:00
Michael Goulet
a5c395ed94
Rollup merge of #109914 - compiler-errors:rtn-bad-parens, r=oli-obk
Emit feature error for parenthesized generics in associated type bounds

We don't actually do AST->HIR lowering with some `-Zunpretty` flags, so it's not correct to just delay a bug instead of emitting a feature error.

Some diagnostics regressed because of the new errors, but oh well. 🤷

Fixes #109898
2023-04-04 09:27:46 -07:00
Michael Goulet
4d32de6fcb
Rollup merge of #109838 - clubby789:non-exhaustive-span, r=Nilstrieb
Fix `non_exhaustive_omitted_patterns` lint span

Fixes #109837

`DUMMY_SP` was being passed as the span in many cases where we have a span available to use. This meant that the location of the violating pattern wasn't shown, or the list of un-covered variants

r? `@Nilstrieb`
2023-04-04 09:27:44 -07:00
Michael Goulet
ec22850c2c
Rollup merge of #109723 - oli-obk:ast_refactor, r=Nilstrieb
Pull some tuple variant fields out into their own struct

This is groundwork for adding more fields to those new structs, but I believe the change to be useful on its own.

r? `@Nilstrieb` but feel free to reroll for `compiler`
2023-04-04 09:27:43 -07:00
Yuki Okushi
1a8612e723
Add regression test for #93911
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-05 01:01:45 +09:00
Oli Scherer
373807a95c Rename ast::Static to ast::StaticItem to match ast::ConstItem 2023-04-04 15:34:40 +00:00
Guillaume Gomez
8aef0c7926 Add GUI test for scrollbar position on source code page 2023-04-04 16:35:53 +02:00
Michael Goulet
72ef85d83e Don't collect return-position impl traits for documentation 2023-04-04 14:03:50 +00:00
clubby789
ebde2ab363 Deny useing tool paths 2023-04-04 14:10:13 +01:00
Oli Scherer
b5d96d5ec5 Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible 2023-04-04 10:39:26 +00:00
bors
7c96e40da8 Auto merge of #109891 - the8472:llvm-16-fixes-79308, r=nikic
llvm 16 finally reconizes some additional vec in-place conversions as noops

closes #79308

r? `@nikic`
2023-04-04 08:54:33 +00:00
kadmin
648a35e327 Add ability to transmute with generic consts
Previously if the expression contained generic consts and did not have a directly equivalent
type, transmuting the type in this way was forbidden, despite the two sizes being identical.
Instead, we should be able to lazily tell if the two consts are identical, and if so allow them
to be transmuted.
2023-04-04 08:05:15 +00:00
bors
35d06f9c74 Auto merge of #109599 - notriddle:notriddle/use-redundant-glob, r=petrochenkov
diagnostics: account for glob shadowing when linting redundant imports

Fixes #92904
2023-04-04 06:41:27 +00:00
Michael Goulet
1b5ac39908 dyn* is a valid const 2023-04-04 00:28:05 +00:00
León Orell Valerian Liehr
6567bc9a47
rustdoc: escape GAT args in more cases 2023-04-04 02:09:23 +02:00
Michael Goulet
ab0b9356e6 Emit feature error for parenthesized generics in associated type bounds 2023-04-03 21:20:48 +00:00
Yuki Okushi
52dad9933b
Rollup merge of #109902 - Nilstrieb:107414test, r=compiler-errors
Add async-await test for #107414

fixes #107414

r? `@cjgillot`
2023-04-04 05:52:36 +09:00
Yuki Okushi
7d3207be97
Rollup merge of #109896 - 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-04 05:52:35 +09:00
Nilstrieb
9e579cc10c Add test 2023-04-03 20:45:02 +02:00
Camille GILLOT
1dde34b831 Bless ui test. 2023-04-03 16:16:14 +00:00
Camille GILLOT
4f97540432 Reinstate confusion note. 2023-04-03 15:59:21 +00:00
Camille GILLOT
4d8ed585f2 Bless mir-opt. 2023-04-03 15:59:21 +00:00
Camille GILLOT
05082f57af Perform match checking on THIR. 2023-04-03 15:59:21 +00:00
Camille GILLOT
28d74a9b72 Shrink binding span. 2023-04-03 15:59:21 +00:00
Nilstrieb
ca79b82c6c 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.
2023-04-03 15:25:06 +00:00
The 8472
7a70647f19 llvm 16 finally reconizes some additional vec in-place conversions as noops 2023-04-03 15:29:46 +02:00
Pietro Albini
bbcbb6fcce
ignore x86-stdcall on mingw 2023-04-03 10:23:16 +02:00
Pietro Albini
48bea636fa
fix solaris ignore 2023-04-03 10:23:15 +02:00
Pietro Albini
bf66ddbf24
fix wrong ignore condition 2023-04-03 10:23:13 +02:00
Pietro Albini
8f8873e386
remove unknown xcore arch 2023-04-03 10:23:09 +02:00
Pietro Albini
3602200d50
make 32bit ignore more accurate 2023-04-03 10:23:08 +02:00
Pietro Albini
e045598c68
remove a bunch of unknown archs from the global_asm tests 2023-04-03 09:30:37 +02:00
Pietro Albini
ef2bf6d505
implement --print=all-target-specs-json 2023-04-03 09:24:14 +02:00
Pietro Albini
e592aaa705
remove invalid ignore-powerpc64le 2023-04-03 09:24:12 +02:00
Pietro Albini
64af509377
remove invalid ignore-pretty 2023-04-03 09:24:11 +02:00
Pietro Albini
8dd6c19379
split invalid only-x86-windows into only-x86 and only-windows 2023-04-03 09:24:10 +02:00
Pietro Albini
703ba0ce26
fix ignore-thumbv8m.base 2023-04-03 09:24:07 +02:00
Matthias Krüger
22df7107bd
Rollup merge of #109873 - jyn514:subdirectories, r=compiler-errors
Move some UI tests into subdirectories
2023-04-03 08:58:55 +02:00
Matthias Krüger
99a71dc4d6
Rollup merge of #109856 - bvanjoi:fix-issue-109304, r=compiler-errors
fix(middle): emit error rather than delay bug when reaching limit

close #109304
2023-04-03 08:58:53 +02:00
bohan
d8a4e7cf51 fix(middle): emit error rather than delay bug when reaching limit 2023-04-03 11:08:14 +08:00
bors
33289132ec Auto merge of #109770 - jyn514:run-make-fulldeps, r=Mark-Simulacrum
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-03 01:34:05 +00:00
jyn
01b75e20f2 Move some UI tests into subdirectories
to avoid going over the existing limit now that the ui-fulldeps tests have
been moved to ui.
2023-04-02 19:42:30 -04:00
jyn
c45037b956 try to fix test-various 2023-04-02 17:54:24 -04:00
clubby789
696f182191 Fix non_exhaustive_omitted_patterns lint span 2023-04-02 16:37:23 +01:00
bors
a5a690cf4b Auto merge of #109008 - clubby789:drop-elaborate-array, r=davidtwco
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-02 12:17:52 +00:00
clubby789
46f7d3deb7 Fix non_exhaustive_omitted_patterns on arguments 2023-04-01 19:15:24 +01:00
Michael Howell
000e94e67d diagnostics: account for glob shadowing when linting redundant imports
Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2023-04-01 11:11:21 -07:00
bors
b9535c0b7d Auto merge of #109801 - aliemjay:test-implied-normalization, r=petrochenkov
add test for normalization in implied bounds query

See https://github.com/rust-lang/rust/issues/109799.
2023-04-01 04:29:53 +00:00
bors
fadf164d8d Auto merge of #109165 - aliemjay:fix-ice-annotation, r=davidtwco
allow ReError in CanonicalUserTypeAnnotation

Why not? we already allow `TyKind::Error`.

Fixes #109072.
2023-03-31 23:15:52 +00:00
bors
5e1d3299a2 Auto merge of #109824 - GuillaumeGomez:rollup-i5r4uts, r=GuillaumeGomez
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-31 20:38:06 +00:00
Guillaume Gomez
32842e87b1
Rollup merge of #109818 - GuillaumeGomez:test-collapsed-item, r=notriddle
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-31 22:32:51 +02:00
Guillaume Gomez
bd4e3f37da
Rollup merge of #109798 - est31:ftl_test_note, r=davidtwco
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-31 22:32:50 +02:00
Guillaume Gomez
45fcb6fd7c
Rollup merge of #109680 - clubby789:array-subslice-2229, r=davidtwco
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-31 22:32:49 +02:00
Guillaume Gomez
6c93c63771
Rollup merge of #109443 - GuillaumeGomez:doc-primitive-hard-error, r=notriddle
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-31 22:32:49 +02:00
Guillaume Gomez
8fe5b56b66
Rollup merge of #109104 - 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-31 22:32:48 +02:00
bors
7402519c63 Auto merge of #109010 - compiler-errors:rtn, r=eholk
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` ✔️

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-31 18:04:12 +00:00
Ali MJ Al-Nasrawy
a42cbdb165 allow ReError in CanonicalUserTypeAnnotation 2023-03-31 14:53:42 +00:00
Guillaume Gomez
efad057eed Add tests to check that collapsed content is expanded when jumping to it 2023-03-31 16:51:50 +02:00
Vadim Petrochenkov
60c6dc07de resolve: Restore some effective visibility optimizations
Something similar was previously removed as a part of #104602, but after this PR all table changes should also be "locally correct" after every update.
2023-03-31 17:07:59 +04:00
Julia Tatz
7b453b9f5a More in-depth documentation for the new debuginfo options 2023-03-31 07:28:39 -04:00
Julia Tatz
0504a33383 Preserve, clarify, and extend debug information
`-Cdebuginfo=1` was never line tables only and
can't be due to backwards compatibility issues.
This was clarified and an option for line tables only
was added. Additionally an option for line info
directives only was added, which is well needed for
some targets. The debug info options should now
behave the same as clang's debug info options.
2023-03-31 07:28:39 -04:00
bors
22a7a19f93 Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obk
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-31 08:50:35 +00:00
Ben Kimock
750707801b Disable the ui panic test on wasm32-bare 2023-03-30 23:46:44 -04:00
Ali MJ Al-Nasrawy
1a54144349 add test for normalization in implied bounds query
See https://github.com/rust-lang/rust/issues/109799.
2023-03-31 03:27:51 +00:00
est31
97fb15d950 Don't emit the OS error in a note
This makes it possible to make the normalization of the error message
more precise, allowing us to not normalize all notes away.
2023-03-31 03:49:21 +02:00
bors
c1d3610ac1 Auto merge of #109791 - compiler-errors:rollup-c3o710k, r=compiler-errors
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-30 22:02:10 +00:00
Guillaume Gomez
fa2824aef4 Add test to ensure doc(primitive) is not recognized anymore 2023-03-30 22:56:52 +02:00
Guillaume Gomez
3ef8d2d607 Update tests for rustc_doc_primitive 2023-03-30 22:56:52 +02:00
Michael Goulet
7cd96ae2d7
Rollup merge of #109739 - compiler-errors:new-solver-closure-fnonce, r=lcnr
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-30 12:42:20 -07:00
Michael Goulet
fbe738345c
Rollup merge of #109704 - petrochenkov:effvisclean, r=jackh726
resolve: Minor improvements to effective visibilities

See individual commits.
2023-03-30 12:42:19 -07:00
Michael Goulet
987628e82b
Rollup merge of #109347 - cjgillot:issue-109305, r=WaffleLapkin
Skip no_mangle if the item has no name.

Fixes https://github.com/rust-lang/rust/issues/109305
2023-03-30 12:42:18 -07:00
bors
ec2f40c6b0 Auto merge of #109740 - 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-30 19:28:56 +00:00
Maybe Waffle
b9d5a6b709 Don't leave a comma at the start of argument list when removing arguments 2023-03-30 17:26:12 +00:00
Maybe Waffle
6975b77e3b Add a test for issue 109396 2023-03-30 17:24:58 +00:00
bors
789ee5e433 Auto merge of #108576 - 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-30 15:21:22 +00:00
Michael Goulet
177997e383 Closures always implement FnOnce in new solver 2023-03-30 15:11:42 +00:00
Patrik Kårlin
1f9e2d0538
rustdoc: tidy excess whitespace 2023-03-30 15:46:34 +02:00
Joshua Nelson
4851d5663c ignore failing cross-compiled run-make tests
`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-30 08:46:31 -05:00
Joshua Nelson
8e214cbc06 fix sysroot-crates-are-unstable for cross-compilation 2023-03-30 08:44:46 -05:00
Joshua Nelson
26e1ce7394 move tools.mk to run-make
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-30 07:58:50 -05:00
Patrik Kårlin
df556a3177
rustdoc: add error messages to the test 2023-03-30 14:55:03 +02:00
Patrik Kårlin
4d571a9ccf
rustdoc: remove other redundant item 2023-03-30 14:55:03 +02:00