Matthias Krüger
f91fa512d1
Rollup merge of #105201 - cjgillot:issue-105040, r=compiler-errors
...
Do not call fn_sig on non-functions.
Fixes https://github.com/rust-lang/rust/issues/105040
Fixes https://github.com/rust-lang/rust/issues/89271
2022-12-03 17:37:45 +01:00
Matthias Krüger
b1e680650e
Rollup merge of #105200 - cjgillot:issue-104562, r=compiler-errors
...
Remove useless filter in unused extern crate check.
Fixes https://github.com/rust-lang/rust/issues/104562
2022-12-03 17:37:44 +01:00
Matthias Krüger
ed9a21eb0c
Rollup merge of #105193 - tmiasko:naked-nocoverage, r=wesleywiser
...
Disable coverage instrumentation for naked functions
Fixes #105170 .
2022-12-03 17:37:44 +01:00
Matthias Krüger
a739fc8153
Rollup merge of #105164 - compiler-errors:revert-import-filter, r=estebank
...
Restore `use` suggestion for `dyn` method call requiring `Sized`
Add the suggestion back that I accidentally removed in 88f2140d87
because I didn't understand that suggestion was actually useful...
Fixes #105159
2022-12-03 17:37:43 +01:00
Matthias Krüger
1a2f79b82c
Rollup merge of #105050 - WaffleLapkin:uselessrefign, r=jyn514
...
Remove useless borrows and derefs
They are nothing more than noise.
<sub>These are not all of them, but my clippy started crashing (stack overflow), so rip :(</sub>
2022-12-03 17:37:42 +01:00
Matthias Krüger
c89bff29e5
Rollup merge of #104199 - SarthakSingh31:issue-97417-1, r=cjgillot
...
Keep track of the start of the argument block of a closure
This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a ) as required by #97417 .
VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem.
r? `@cjgillot`
2022-12-03 17:37:41 +01:00
Camille GILLOT
e973240d18
Do not call fn_sig on non-functions.
2022-12-03 09:34:06 +00:00
Camille GILLOT
59cc6cd4ac
Remove useless filter in unused extern crate check.
2022-12-03 09:23:03 +00:00
bors
703d95e183
Auto merge of #105133 - oli-obk:promoted_def_ids, r=cjgillot
...
Ensure query backtraces work for `DefId`s created after ast lowering
r? `@cjgillot`
2022-12-03 08:17:46 +00:00
Yuki Okushi
7d4af8852c
Rollup merge of #105188 - compiler-errors:verbose-ty-err, r=TaKO8Ki
...
Don't elide type information when printing E0308 with `-Zverbose`
When we pass `-Zverbose`, we kinda expect for all `_` to be replaced with more descriptive information, for example --
```
= note: expected fn pointer `fn(_, u32)`
found fn item `fn(_, i32) {foo}`
```
Where `_` is the "identical" part of the fn signatures, now gets rendered as:
```
= note: expected fn pointer `fn(i32, u32)`
found fn item `fn(i32, i32) {foo}`
```
2022-12-03 12:51:30 +09:00
Yuki Okushi
8f368666b5
Rollup merge of #105181 - bhbs:skip-note, r=estebank
...
Don't add a note for implementing a trait if its inner type is erroneous
Fix #105138
2022-12-03 12:51:29 +09:00
Yuki Okushi
52e886279a
Rollup merge of #104903 - spastorino:consolidate-normalize-in-report_projection_error, r=lcnr
...
Use ocx.normalize in report_projection_error
r? `@lcnr`
cc `@compiler-errors`
2022-12-03 12:51:27 +09:00
bhbs
715d4a8949
Don't add a note for implementing a trait if its inner type is erroneous
2022-12-03 09:06:47 +09:00
Tomasz Miąsko
b740cdcf43
Mark naked functions as never inline in codegen_fn_attrs
...
Use code generation attributes to ensure that naked functions are never
inline, replacing separate checks in MIR inliner and LLVM code
generation.
2022-12-03 01:04:42 +01:00
Tomasz Miąsko
c955add18c
Disable coverage instrumentation for naked functions
2022-12-03 01:03:28 +01:00
Michael Goulet
5c642d7d1c
Don't elide information when printing E0308 with Zverbose
2022-12-02 21:01:59 +00:00
Santiago Pastorino
89047430f1
Define values and err as non mutable
2022-12-02 17:31:45 -03:00
Santiago Pastorino
4dacf4f469
Use ocx.normalize in report_projection_error
2022-12-02 17:31:40 -03:00
Matthias Krüger
8e0d83a70c
Rollup merge of #105185 - compiler-errors:normalize_fn_sig-in-err-ctxt, r=lcnr
...
Move `normalize_fn_sig` to `TypeErrCtxt`
r? `@lcnr`
2022-12-02 21:22:50 +01:00
Matthias Krüger
09e2d0f289
Rollup merge of #105163 - compiler-errors:afit-lt-arity, r=jackh726
...
Check lifetime param count in `collect_trait_impl_trait_tys`
We checked the type and const generics count, but not the lifetimes, which were handled in a different function.
Fixes #105154
2022-12-02 21:22:50 +01:00
Matthias Krüger
babdf86952
Rollup merge of #105162 - compiler-errors:fn-sig-arity, r=cjgillot
...
Properly synthesize `FnSig` value during cycle
Get the arity correct when creating a `FnSig` type during `tcx.fn_sig` cycle recovery
Fixes #105152
2022-12-02 21:22:49 +01:00
Matthias Krüger
b5b2d03c0c
Rollup merge of #105144 - compiler-errors:normalization-doc, r=lcnr
...
Document normalization methods `At::{normalize,query_normalize}`
r? ``@lcnr``
2022-12-02 21:22:48 +01:00
Matthias Krüger
dab14348e9
Rollup merge of #105026 - oToToT:aarch64-v8a, r=davidtwco
...
v8a as default aarch64 target
After https://github.com/llvm/llvm-project/commit/8689f5e landed, LLVM takes the intersection of v8a and v8r as default. This commit brings back v8a support by explicitly specifying v8a in the feature list.
This should solve #97724 .
p.s. a bit more context can also be found in https://github.com/llvm/llvm-project/issues/57904#issuecomment-1329555590 .
2022-12-02 21:22:47 +01:00
Michael Goulet
ffca711760
Move normalize_fn_sig to TypeErrCtxt
2022-12-02 19:29:14 +00:00
bors
e960b5e774
Auto merge of #104863 - nnethercote:reduce-lint-macros, r=cjgillot
...
Reduce macro usage for lints
r? `@cjgillot`
2022-12-02 15:31:15 +00:00
Matthias Krüger
46c50af977
Rollup merge of #105136 - RalfJung:deref-promotion-comment, r=oli-obk
...
clarify comment on Deref promotion
r? `@oli-obk`
2022-12-02 08:28:10 +01:00
Matthias Krüger
4fdc3eb176
Rollup merge of #104614 - Nilstrieb:type-ascribe!, r=TaKO8Ki
...
Add `type_ascribe!` macro as placeholder syntax for type ascription
This makes it still possible to test the internal semantics of type ascription even once the `:`-syntax is removed from the parser. The macro now gets used in a bunch of UI tests that test the semantics and not syntax of type ascription.
I might have forgotten a few tests but this should hopefully be most of them. The remaining ones will certainly be found once type ascription is removed from the parser altogether.
Part of #101728
2022-12-02 08:28:08 +01:00
Michael Goulet
dc45eb93f7
Revert 88f2140
2022-12-02 00:05:35 -05:00
Michael Goulet
5809a0591d
Properly synthesize fn sig value during cycle
2022-12-01 23:56:57 -05:00
bors
11663b1b48
Auto merge of #104963 - petrochenkov:noaddids2, r=cjgillot
...
rustc_ast_lowering: Stop lowering imports into multiple items
Lower them into a single item with multiple resolutions instead.
This also allows to remove additional `NodId`s and `DefId`s related to those additional items.
2022-12-02 04:24:57 +00:00
Nicholas Nethercote
406dace6f2
Inline and remove early_lint_node
.
...
It has a single call site.
2022-12-02 15:24:01 +11:00
Nicholas Nethercote
a9b02af62b
Merge builtins
into EarlyLintPassObjects
.
...
This avoids calling `early_lint_node` twice.
Note: one `early_lint_node` call had `!pre_expansion` for the second
argument and the other had `false`. The new single call just has
`!pre_expansion`. This results in a reduction of duplicate error
messages in some `ui-fulldeps` tests. The order of some `ui-fulldeps`
output also changes, but that doesn't matter.
2022-12-02 15:23:28 +11:00
Michael Goulet
bd7ee07d02
Check lifetime param count in collect_trait_impl_trait_tys
2022-12-02 04:05:39 +00:00
Nicholas Nethercote
44cb4f70a8
Remove some unnecessary Send
bounds.
...
Required to get the parallel compiler building again.
2022-12-02 13:59:28 +11:00
Nicholas Nethercote
357aee9320
Inline and remove late_lint_pass_crate
.
...
It has a single call site.
2022-12-02 13:59:28 +11:00
Nicholas Nethercote
0e4f55d63f
Inline and remove late_lint_mod_pass
.
...
It has a single call site.
2022-12-02 13:59:28 +11:00
Nicholas Nethercote
890c5ead20
Merge builtins
into LateLintPassObjects
.
...
This avoids calling the `late_lint_{mod_pass,pass_crate}` twice.
2022-12-02 13:59:28 +11:00
Nicholas Nethercote
99e9c1ddb7
Remove six macros relating to lint definitions.
...
These were enabled by the removal of `-Zno-interleave-lints`.
2022-12-02 13:59:28 +11:00
Nicholas Nethercote
67cfe2cfbb
Remove -Zno-interleave-lints
.
...
Because it complicates lint implementation greatly.
2022-12-02 13:59:28 +11:00
Nicholas Nethercote
33faf01690
Eliminate four unnecessary lint macros.
...
The lint definitions use macros heavily. This commit merges some of them
that are split unnecessarily. I find the reduced indirection makes it
easier to imagine what the generated code will look like.
2022-12-02 13:59:28 +11:00
Michael Goulet
02b64c5d26
Document normalization methods on At
2022-12-01 19:00:09 +00:00
Michael Goulet
e45daa9856
Drive-by: remove unused type alias
2022-12-01 19:00:09 +00:00
bors
c090c6880c
Auto merge of #105125 - matthiaskrgr:rollup-fr0snmj, r=matthiaskrgr
...
Rollup of 4 pull requests
Successful merges:
- #105078 (Fix `expr_to_spanned_string` ICE)
- #105087 (Extract llvm datalayout parsing out of spec module)
- #105088 (rustdoc: remove redundant CSS `div.desc { display: block }`)
- #105106 (Fix ICE from #105101 )
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-01 17:47:12 +00:00
Maybe Waffle
083ef45458
rustc_data_structures
deref in a more humane way
2022-12-01 17:34:45 +00:00
Maybe Waffle
f2b97a8bfe
Remove useless borrows and derefs
2022-12-01 17:34:43 +00:00
Vadim Petrochenkov
b32a4edb20
rustc_ast_lowering: Stop lowering imports into multiple items
...
Lower them into a single item with multiple resolutions instead.
This also allows to remove additional `NodId`s and `DefId`s related to those additional items.
2022-12-01 18:51:20 +03:00
Vadim Petrochenkov
1f259ae679
rustc_hir: Change representation of import paths to support multiple resolutions
2022-12-01 18:51:05 +03:00
Ralf Jung
b7f2b1cd5c
clarify comment on Deref promotion
2022-12-01 16:42:33 +01:00
Vadim Petrochenkov
6cd4dd3091
rustc_hir: Relax lifetime requirements on Visitor::visit_path
2022-12-01 17:04:02 +03:00
Matthias Krüger
ee9eaa695c
Rollup merge of #105106 - jhpratt:issue-105101, r=TaKO8Ki
...
Fix ICE from #105101
Fixes #105101
Rather than comparing idents, compare spans, which should be unique to each variant.
2022-12-01 11:59:01 +01:00