Commit Graph

30996 Commits

Author SHA1 Message Date
Nicholas Nethercote
4dc7fab56f Rename __diagnostic_handler_sess as _sess. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote
7b8644e5cf Rename DiagnosticDeriveKind::Diagnostic::handler as DiagnosticDeriveKind::Diagnostic::dcx. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote
f7125f1f66 Rename CollectProcMacros::handler as CollectProcMacros::dcx. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote
b107ab81ad Rename EarlyDiagCtxt::handler as EarlyDiagCtxt::dcx. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote
20cb12ede1 Rename SilentEmitter::fatal_handler as SilentEmitter::fatal_dcx. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote
55bafab566 Rename UnstableOptions::diagnostic_handler_flags as UnstableOptions::dcx_flags. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
7c656bc05b Rename CodegenContext::create_diag_handler as CodegenContext::create_dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
dea752e53d Rename ShowSpanVisitor::span_diagnostic as ShowSpanVisitor::dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
5ad7144d1b Rename AstValidator::err_handler as AstValidator::dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
9f3f1ca8c4 Rename DiagnosticBuilder::handler as DiagnosticBuilder::dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
d1d0896c40 Rename ParseSess::with_span_handler as ParseSess::with_dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
73bac456d4 Rename Parser::span_diagnostic as Parser::dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
09af8a667c Rename Session::span_diagnostic as Session::dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
9df1576e1d Rename ParseSess::span_diagnostic as ParseSess::dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
9b1f87c7e8 Rename HandlerFlags as DiagCtxtFlags. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
cce1701c4c Rename EarlyErrorHandler as EarlyDiagCtxt. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
45f347681d Rename HandlerInner as DiagCtxtInner. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
cde19c016e Rename Handler as DiagCtxt. 2023-12-18 16:06:19 +11:00
Vadim Petrochenkov
be321aa473 resolve: Replace visibility table in resolver outputs with query feeding
Also feed missing visibilities for import stems and trait impl items, which were previously evaluated lazily.
2023-12-18 02:26:55 +03:00
Matthias Krüger
39fe059a35
Rollup merge of #119052 - cjgillot:gvn-index-overflow, r=compiler-errors
Avoid overflow in GVN constant indexing.

Fixes https://github.com/rust-lang/rust/issues/118992
Fixes https://github.com/rust-lang/rust/issues/119008
2023-12-17 21:30:00 +01:00
Matthias Krüger
677bb6cd60
Rollup merge of #119022 - compiler-errors:no-constness, r=fee1-dead
Remove unnecessary constness from ProjectionCandidate

Constness in an item bound will be represented by an effect param, so no need to record constness here.

r? fee1-dead
2023-12-17 21:30:00 +01:00
Matthias Krüger
93d3a4231e
Rollup merge of #118928 - EliseZeroTwo:EliseZeroTwo/fix-issue-118786, r=cjgillot
fix: Overlapping spans in delimited meta-vars

Closes #118786

Delimited meta-vars inside of MBE's spans were set to have the same opening and closing position resulting in an ICE when debug assertions were enabled and an error was present in the templated code.

This ensures that the spans do not overlap, whilst still having the spans point at the usage of the meta-var inside the macro definition.

It includes a regression test.

🖤
2023-12-17 21:29:59 +01:00
Matthias Krüger
6269bf1a3a
Rollup merge of #118880 - GearsDatapacks:issue-118859-fix, r=compiler-errors
More expressions correctly are marked to end with curly braces

Fixes #118859, and replaces the mentioned match statement with an exhaustive list, so that this code doesn't get overlooked in the future
2023-12-17 21:29:59 +01:00
Camille GILLOT
8022057ebb Avoid overflow in GVN constant indexing. 2023-12-17 19:50:38 +00:00
bors
4283aeaca5 Auto merge of #119048 - aliemjay:perf-register-pred, r=compiler-errors
don't fold ParamEnv in register_predicate_obligation

\>5% perf gain for diesel!
2023-12-17 18:27:09 +00:00
Ali MJ Al-Nasrawy
e0df93b07e don't fold ParamEnv in register_predicate_obligation 2023-12-17 17:24:04 +00:00
bors
d14e52b47a Auto merge of #117884 - bvanjoi:fix-117794, r=compiler-errors
skip rpit constraint checker if borrowck return type error

Fixes #117794
Fixes #117886
Fixes #119025

Prior to change #117418, the value of `concrete_opaque_types` for `mir_borrock(T:🅰️:opaque)` was `None`. However, due to modifications in `body.local_decls`, the return value had been changed.

The changed of `body.local_decls` has let to the addition of `ty:Error` to `infcx.opaque_type_storage.opaque_types` during `TypeChecker::equate_inputs_and_outputs`. This is due to it utilizing the output of a function signature that was appended during `construct_error`(which previously only appended a `ty::Error`) and then execute `TypeChecker::Related_types`.

Therefore, in this PR, I've implemented a condition to bypass the rpit check when an error is encountered.

r? `@compiler-errors`
2023-12-17 16:28:37 +00:00
bors
e95a69d306 Auto merge of #118828 - mu001999:master, r=b-naber
Remove dead codes in rustc_codegen_gcc

Detected by #118257
2023-12-17 12:15:56 +00:00
bohan
64e311add2 skip rpit constraint check if borrowck return type error 2023-12-17 16:49:00 +08:00
bors
9f13b9d9ca Auto merge of #119000 - celinval:smir-cstr, r=ouz-a
Add a method to StableMIR to check if a type is a CStr

Also add a check that StableMIR works properly with C string literal.
2023-12-17 08:18:17 +00:00
bors
5e7025419d Auto merge of #118830 - GuillaumeGomez:env-tracked_env, r=Nilstrieb
Add support for `--env` on `tracked_env::var`

Follow-up of https://github.com/rust-lang/rust/pull/118368.
Part of Part of https://github.com/rust-lang/rust/issues/80792.

It adds support of the `--env` option for proc-macros through `tracked_env::var`.

r? `@Nilstrieb`
2023-12-17 04:23:08 +00:00
bors
02ad6676dd Auto merge of #110494 - majaha:noTrapAfterNoreturn, r=nikic
Use the LLVM option NoTrapAfterNoreturn

Use this LLVM option: https://llvm.org/doxygen/classllvm_1_1TargetOptions.html#acd83fce25de1ac9f6c975135a8235c22 when TrapUnreachable is enabled. This prevents codegenning unnecessary double-traps in some situations.

See further discussion here: https://github.com/rust-lang/compiler-team/issues/618
2023-12-16 18:55:01 +00:00
Michael Goulet
20927d3956 Remove unnecessary constness from ProjectionCandidate 2023-12-16 17:21:20 +00:00
bors
3ad8e2d129 Auto merge of #118897 - nnethercote:more-unescaping-cleanups, r=fee1-dead
More unescaping cleanups

More minor improvements I found while working on #118699.

r? `@fee1-dead`
2023-12-16 08:52:06 +00:00
Jubilee
c5a3d98cc6
Rollup merge of #119004 - matthiaskrgr:conv, r=compiler-errors
NFC don't convert types to identical types
2023-12-15 21:33:00 -08:00
Jubilee
c9ba4583aa
Rollup merge of #119003 - matthiaskrgr:nein_clone, r=Nadrieril
NFC: do not clone types that are copy
2023-12-15 21:33:00 -08:00
Jubilee
30231d9afa
Rollup merge of #118993 - jyn514:cfg-color, r=WaffleLapkin,Nilstrieb
use `if cfg!` instead of `#[cfg]`

this pr is specifically for waffle because i love it <3

fixes https://github.com/rust-lang/rust/pull/118756#discussion_r1421767649

r? `@WaffleLapkin`
2023-12-15 21:32:59 -08:00
Jubilee
c7b492eac1
Rollup merge of #118989 - compiler-errors:lint-decorator-2, r=WaffleLapkin
Simplify lint decorator derive too

See last commit, since this is stacked on top of #118727.

r? WaffleLapkin
2023-12-15 21:32:58 -08:00
Michael Goulet
108bec6723 Simplify lint decorator derive too 2023-12-16 02:07:01 +00:00
Michael Goulet
32907c72eb Remove the lint outright 2023-12-16 01:28:06 +00:00
Michael Goulet
629d3511b7 Make IMPLIED_BOUNDS_ENTAILMENT into a hard error from a lint 2023-12-16 01:28:05 +00:00
Matthias Krüger
8479945c08 NFC don't convert types to identical types 2023-12-15 23:56:24 +01:00
Matthias Krüger
74d81d15b4 NFC: do not clone types that are copy 2023-12-15 23:19:51 +01:00
Jubilee
3d94fc9dfe
Rollup merge of #118981 - krtab:onelessalloc, r=compiler-errors
Remove an unneeded allocation

This removes an unneeded allocation in `<&[hir::GenericParam<'_>] as NextTypeParamName>::next_type_param_name`
2023-12-15 14:08:17 -08:00
Jubilee
58353fa458
Rollup merge of #118727 - compiler-errors:lint-decorate, r=WaffleLapkin
Don't pass lint back out of lint decorator

Change the decorator function in the signature of the `emit_lint`/`span_lint`/etc family of methods from `impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>) -> &'b mut DiagnosticBuilder<'a, ()>` to `impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>)`. I consider it easier to read this way, especially when there's control flow involved.

r? nnethercote though feel free to reassign
2023-12-15 14:08:16 -08:00
Jubilee
1d54949765
Rollup merge of #118396 - compiler-errors:ast-lang-items, r=cjgillot
Collect lang items from AST, get rid of `GenericBound::LangItemTrait`

r? `@cjgillot`
cc #115178

Looking forward, the work to remove `QPath::LangItem` will also be significantly more difficult, but I plan on doing it as well. Specifically, we have to change:
1. A lot of `rustc_ast_lowering` for things like expr `..`
2. A lot of astconv, since we actually instantiate lang and non-lang paths quite differently.
3. A ton of diagnostics and clippy lints that are special-cased via `QPath::LangItem`

Meanwhile, it was pretty easy to remove `GenericBound::LangItemTrait`, so I just did that here.
2023-12-15 14:08:15 -08:00
Celina G. Val
86451badf1 Add a method to check if type is a CStr 2023-12-15 13:18:41 -08:00
bors
a96d57bdb6 Auto merge of #118996 - matthiaskrgr:rollup-n6x2lc7, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #117824 (Stabilize `ptr::{from_ref, from_mut}`)
 - #118234 (Stabilize `type_name_of_val`)
 - #118944 (Move type relations into submodule `relate` in rustc_infer, and notify when it has changed)
 - #118977 (Simplify `src-script.js` code)
 - #118985 (Remove `@JohnTitor` from diagnostics pings)
 - #118986 (Simplify JS code a little bit)
 - #118988 (rustdoc: add regression test for JS data file loading)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-15 19:32:17 +00:00
jyn
4845665f6a use if cfg instead of #[cfg]
this pr is specifically for waffle because i love it <3
2023-12-15 13:15:40 -05:00
Michael Goulet
0184c7616e Move nll_relate to relate::nll submodule 2023-12-15 18:13:40 +00:00