Matthias Krüger
c571b2a964
Rollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, r=fee1-dead
...
Improve spans for RPITIT object-safety errors
No reason why we can't point at the `impl Trait` that causes the object-safety violation.
Also [drive-by: Add is_async fn to hir::IsAsync](c4165f3a96
), which touches clippy too.
2022-11-19 15:35:23 +01:00
Dylan DPC
00876c68c4
Rollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errors
...
nll: correctly deal with bivariance
fixes #104409
when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions.
r? types cc ``@RalfJung``
2022-11-19 11:54:44 +05:30
Michael Goulet
c36ff28d42
drive-by: PolyExistentialPredicate
2022-11-19 04:04:27 +00:00
Michael Goulet
c4165f3a96
drive-by: Add is_async fn to hir::IsAsync
2022-11-19 02:22:24 +00:00
Ralf Jung
09a887cebf
review feedback
2022-11-18 14:24:48 +01:00
Ralf Jung
4101889786
interpret: use Either over Result when it is not representing an error condition
2022-11-18 10:18:32 +01:00
Matthias Krüger
ed97f245f1
Rollup merge of #104483 - oli-obk:santa-clauses-make-goals, r=compiler-errors
...
Convert predicates into Predicate in the Obligation constructor
instead of having almost all callers do that.
This reduces a bit of boilerplate, and also paves the way for my work towards https://github.com/rust-lang/compiler-team/issues/531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).
2022-11-17 22:33:19 +01:00
yukang
20ea083d87
fix #104390 , fix ICE in in_operand for ty error
2022-11-16 17:48:13 +08:00
Oli Scherer
4f11f3b257
Convert predicates into Predicate in the Obligation constructor
2022-11-16 09:25:19 +00:00
Ralf Jung
1115ec601a
cleanup and dedupe CTFE and Miri error reporting
2022-11-16 10:13:29 +01:00
bors
a00f8ba7fc
Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obk
...
interpret: support for per-byte provenance
Also factors the provenance map into its own module.
The third commit does the same for the init mask. I can move it in a separate PR if you prefer.
Fixes https://github.com/rust-lang/miri/issues/2181
r? `@oli-obk`
2022-11-15 17:37:15 +00:00
lcnr
b2e6d08e3f
use ocx
type relation routines
2022-11-15 14:13:47 +01:00
lcnr
f5f67618e2
add comment about opaque types
2022-11-15 13:50:13 +01:00
lcnr
6aa611a84c
mv utility methods into separate module
2022-11-15 13:50:13 +01:00
lcnr
45f441a7b4
nll: correctly deal with bivariance
2022-11-15 13:34:08 +01:00
Matthias Krüger
050ece6765
Rollup merge of #104356 - RalfJung:interpret-check-mplace, r=oli-obk
...
interpret: make check_mplace public
This helps avoid code duplication in https://github.com/rust-lang/miri/pull/2661 .
2022-11-14 19:26:18 +01:00
Matthias Krüger
5763fa74f0
Rollup merge of #104349 - rustaceanclub:master, r=oli-obk
...
fix some typos in comments
2022-11-14 19:26:18 +01:00
Ralf Jung
68af46c112
assert that we are (de)seiralizing ProvenanceMap correctly
2022-11-14 18:26:40 +01:00
Ralf Jung
7982d6ac64
interpret: make check_mplace public
2022-11-13 12:56:48 +01:00
Ralf Jung
c78021709a
add is_sized method on Abi and Layout, and use it
2022-11-13 12:23:53 +01:00
cui fliter
442f848d74
fix some typos in comments
...
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-11-13 15:26:17 +08:00
Dylan DPC
77a44ab568
Rollup merge of #103865 - compiler-errors:fallback-has-occurred-tracking, r=eholk
...
Move `fallback_has_occurred` state tracking to `FnCtxt`
Removes a ton of callsites that defaulted to `false`
2022-11-08 11:23:51 +05:30
Ralf Jung
c3a7ca1125
move InitMask to its own module
2022-11-06 14:17:10 +01:00
Ralf Jung
2cef9e3d19
interpret: support for per-byte provenance
2022-11-06 14:17:10 +01:00
Michael Goulet
bc345d7bd0
Move fallback_has_occurred to FnCtxt
2022-11-06 02:40:25 +00:00
bors
a4ab2e0643
Auto merge of #103975 - oli-obk:tracing, r=jackh726
...
Some tracing and comment cleanups
Pulled out of https://github.com/rust-lang/rust/pull/101900 to see if that is the perf impact
2022-11-06 02:21:34 +00:00
Matthias Krüger
ad01a37ca9
Rollup merge of #103868 - compiler-errors:trait-engine-less, r=jackh726
...
Use `TraitEngine` (by itself) less
Replace `TraitEngine` in favor of `ObligationCtxt` or `fully_solve_*`, improving code readability.
2022-11-05 00:02:04 +01:00
Oli Scherer
44d1936d00
Some tracing and comment cleanups
2022-11-04 17:10:07 +00:00
Matthias Krüger
61c6cdb5f4
Rollup merge of #103915 - chenyukang:yukang/fix-103874, r=lcnr
...
Improve use of ErrorGuaranteed and code cleanup
Part of #103874
2022-11-04 06:40:32 +01:00
yukang
a21a055ca6
remove 'delay_span_bug' following 'references_error'
2022-11-03 09:22:08 +08:00
yukang
7df9d818ab
deprecate DelaySpanBugEmitted and use ErrorGuaranteed directly
2022-11-02 23:15:49 +08:00
Michael Goulet
41e4218d2a
Use TraitEngine less
2022-11-02 04:11:05 +00:00
Michael Goulet
e24df2778f
Format dyn Trait better in type_name intrinsic
2022-11-01 20:41:47 +00:00
Dylan DPC
20528baac4
Rollup merge of #103729 - RalfJung:align-of-val-packed, r=oli-obk
...
interpret: fix align_of_val on packed types
Fixes https://github.com/rust-lang/miri/issues/2632
r? `@oli-obk`
2022-11-01 14:12:26 +05:30
Yuki Okushi
0f40e95b2e
Rollup merge of #103798 - RalfJung:type_name, r=oli-obk
...
interpret: move type_name implementation to an interpreter-independent helper file
This should avoid pinging rust-lang/miri each time that file changes, which is really not necessary.
r? `@oli-obk`
2022-11-01 12:03:43 +09:00
Ralf Jung
fa2aa1cedb
interpret: move type_name implementation to an interpreter-independent helper file
2022-10-31 11:04:03 +01:00
Dylan DPC
c1c2922aa1
Rollup merge of #103603 - camsteffen:refactor-lang, r=oli-obk
...
Lang item cleanups
Various cleanups related to lang items.
2022-10-31 14:52:56 +05:30
Sarthak Singh
8609364480
All verbosity checks in PrettyPrinter
now go through PrettyPrinter::should_print_verbose
2022-10-30 20:37:43 +05:30
Cameron Steffen
a6180ede5c
Simplify lang item groups
2022-10-29 16:04:10 -05:00
Ralf Jung
d366471e58
interpret: fix align_of_val on packed types
2022-10-29 15:58:32 +02:00
Guillaume Gomez
2414a4c31a
Rollup merge of #103625 - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errors
...
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions
Functions in answer:
- `Ty::is_freeze`
- `Ty::is_sized`
- `Ty::is_unpin`
- `Ty::is_copy_modulo_regions`
This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3
r? `@compiler-errors`
2022-10-29 14:18:03 +02:00
bors
5237c4d83d
Auto merge of #102674 - CastilloDel:master, r=oli-obk
...
Remove allow(rustc::potential_query_instability) in rustc_const_eval
The use of FxHashMap has been replaced with FxIndexMap.
Related to #84447
2022-10-28 12:52:17 +00:00
Maybe Waffle
a17ccfa621
Accept TyCtxt
instead of TyCtxtAt
in Ty::is_*
functions
...
Functions in answer:
- `Ty::is_freeze`
- `Ty::is_sized`
- `Ty::is_unpin`
- `Ty::is_copy_modulo_regions`
2022-10-27 15:06:08 +04:00
bors
0a6b941df3
Auto merge of #103572 - Dylan-DPC:rollup-a8bnxrw, r=Dylan-DPC
...
Rollup of 6 pull requests
Successful merges:
- #95710 (Stabilize arbitrary_enum_discriminant, take 2)
- #102706 (Support excluding the generation of the standalone docs)
- #103428 (Removed verbose printing from the `PrettyPrinter` when printing constants)
- #103543 (Update books)
- #103546 (interpret: a bit of cast cleanup)
- #103554 (rustdoc: add visible focus outline to rustdoc-toggle)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-26 14:12:16 +00:00
Dylan DPC
709462bfe1
Rollup merge of #103546 - RalfJung:cast, r=oli-obk
...
interpret: a bit of cast cleanup
r? `@oli-obk`
2022-10-26 17:32:55 +05:30
Dylan DPC
ffde0f722e
Rollup merge of #103428 - SarthakSingh31:issue-94187, r=compiler-errors
...
Removed verbose printing from the `PrettyPrinter` when printing constants
Partially solves #94187 by completing the first step described in [this comment](https://github.com/rust-lang/rust/issues/94187#issuecomment-1282339909 ).
2022-10-26 17:32:54 +05:30
bors
43dd3d514b
Auto merge of #103284 - compiler-errors:const-sad, r=oli-obk
...
Revert "Unify tcx.constness and param env constness checks"
Too much of a perf regression https://github.com/rust-lang/rust/pull/102975#issuecomment-1282702513 , and an attempt in #103263 didn't fix it except for just a tiny bit.
This change isn't really needed (see https://github.com/rust-lang/rust/pull/102830#issuecomment-1272514096 ), so this should be an easy revert.
2022-10-26 11:29:15 +00:00
bors
629a414d7b
Auto merge of #103562 - Dylan-DPC:rollup-sheepp5, r=Dylan-DPC
...
Rollup of 10 pull requests
Successful merges:
- #102951 (suggest type annotation for local statement initialed by ref expression)
- #103209 (Diagnostic derives: allow specifying multiple alternative suggestions)
- #103287 (Use a faster allocation size check in slice::from_raw_parts)
- #103416 (Name the `impl Trait` in region bound suggestions)
- #103430 (Workaround unstable stmt_expr_attributes for method receiver expressions)
- #103444 (Remove extra type error after missing semicolon error)
- #103520 (rustc_middle: Rearrange resolver outputs structures slightly)
- #103533 (Use &self instead of &mut self for cast methods)
- #103536 (Remove `rustc_driver::set_sigpipe_handler()`)
- #103542 (Pinning tests for some `macro_rules!` errors discussed in the lang meeting)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-26 07:58:28 +00:00
Dylan DPC
39e0e2cc24
Rollup merge of #103533 - jachris:cast-without-mut, r=oli-obk
...
Use &self instead of &mut self for cast methods
r? ``@oli-obk``
2022-10-26 11:29:56 +05:30
bors
d49e7e7fa1
Auto merge of #103279 - compiler-errors:normalize-hack-back, r=lcnr
...
Add eval hack in `super_relate_consts` back
Partially reverts 01adb7e98d5656c06497f33dd2747df144e78356.
This extra eval call *still* needs to happen, for example, in `normalize_param_env_or_error` when a param-env predicate has an unnormalized constant, since the param-env candidates never get normalized during candidate assembly (everywhere else we can assume that they are normalized fully).
r? `@lcnr,` though I feel like I've assigned quite a few PRs to you in the last few days, so feel free to reassign to someone else familiar with this code if you're busy!
cc #103243 (fixes the issue, but don't want to auto-close that until a backport is performed).
2022-10-26 05:17:46 +00:00