Yuki Okushi
6245b951d5
Rollup merge of #77420 - ecstatic-morse:const-checking-raw-mut-ref, r=davidtwco
...
Unify const-checking structured errors for `&mut` and `&raw mut`
Resolves #77414 as well as a FIXME.
2020-10-22 09:45:25 +09:00
Dylan MacKenzie
9beb6f81e4
Make impl Trait
unstable in all contexts
2020-10-05 21:44:00 -07:00
Dylan MacKenzie
c4ef5fdf8f
Remove fn
from feature name
2020-10-05 21:44:00 -07:00
Dylan MacKenzie
e1d76818b2
Add #![feature(const_fn_impl)]
2020-10-05 19:56:50 -07:00
Dylan MacKenzie
98a2292919
Allow Abort
terminators in a const-context
...
These appear along the cleanup path inside functions with
`#[unwind(aborts)]`. We don't const-check the cleanup path anyways,
since const-eval already has "abort-on-panic" semantics and there's
often drops that would otherwise be forbidden, so the check wasn't
really preventing anything anyways.
2020-10-03 14:38:01 -07:00
Dylan MacKenzie
77e6c56ab6
Unify &mut
and &raw mut
const-checking errors
2020-10-01 11:04:33 -07:00
Dylan MacKenzie
50e0c0d97b
Give better const-checking error for async
blocks
2020-10-01 10:11:58 -07:00
Dylan MacKenzie
1301f43119
Remove E0019, use E0015 for inline assembly in a const
2020-09-30 11:29:25 -07:00
Dylan MacKenzie
1513904c1c
Remove default build_error
impl
...
Now all structured errors must have their own error code
2020-09-29 21:17:48 -07:00
Dylan MacKenzie
287993c961
Remove machinery for halting error output
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
e02ea835a7
Don't stop const-checking after erroneous trait bound
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
37f37dc5ba
Emit multiple function pointer errors from const-checker
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
5b3145574e
Priority levels
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
a23297f5c0
Bless mut tests
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
b518ccb4c3
Give MutDeref
a real error message
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
de35c4293d
Remove ops::non_const
...
This helper function was meant to reduce code duplication between
const-checking pre- and post-drop-elaboration. Most of the functionality
is only relevant for the pre-drop-elaboration pass.
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
ce50939952
Fix "unstable in stable" error
...
The "otherwise" note is printed before the suggestion currently.
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
782a595d7c
Return a DiagnosticBuilder
from structured errors
...
This ensures that `emit_error` will actually cause compilation to fail.
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
20e07e7b8e
Forbid generator-specific MIR in all const-contexts
2020-09-29 19:20:33 -07:00
Dylan MacKenzie
25c7753eee
Continue after impl Trait
in const fn
2020-09-29 19:13:11 -07:00
Dylan MacKenzie
325b7d42ec
Continue const-checking after errors when easy
...
This doesn't change any UI test output
2020-09-29 17:38:28 -07:00
Dylan MacKenzie
1ff143191c
Add a feature gate for basic function pointer use in const fn
2020-09-27 10:46:41 -07:00
Dylan MacKenzie
0d2521aaf7
Add const_fn_floating_point_arithmetic
2020-09-25 10:37:52 -07:00
Jonas Schievink
b8d158b0f8
Rollup merge of #77160 - ecstatic-morse:const-fn-transmute-suggestion, r=oli-obk
...
Suggest `const_fn_transmute`, not `const_fn`
More fallout from #76850 in the vein of #77134 . The fix is the same. I looked through the structured errors file and didn't see any more of this kind of diagnostics bug.
r? @oli-obk
2020-09-25 02:29:49 +02:00
Dylan MacKenzie
ebf024bba8
Suggest const_fn_transmute
instead of const_fn
2020-09-24 12:07:41 -07:00
Dylan MacKenzie
a320ef751b
Suggest const_mut_refs
for mutable references in const fn
2020-09-23 21:04:07 -07:00
Dylan MacKenzie
186d148b4c
Use correct feature gate for unsizing casts
2020-09-22 10:22:50 -07:00
Dylan MacKenzie
5ee5429e00
Add structured errors for qualify_min_const_fn
checks
2020-09-22 10:05:58 -07:00
Dylan MacKenzie
bfc10a89c3
Allow errors to abort const checking when emitted
...
This is a hack for parity with `qualify_min_const_fn`, which only
emitted a single error.
2020-09-22 10:05:58 -07:00
Dylan MacKenzie
7fb9587a3c
Return true
if check_const
emits an error
2020-09-22 10:05:58 -07:00
Dylan MacKenzie
a173c5c1b3
Add const-stability helpers
2020-09-22 10:05:58 -07:00
Dylan MacKenzie
3dd28c78c3
Useful derives on ops::Status
2020-09-22 10:05:58 -07:00
Dylan MacKenzie
81b3b66487
Error if an unstable const eval feature is used in a stable const fn
2020-09-16 14:17:51 -07:00
Dylan MacKenzie
e4edc161f2
Give name to extra Span
in LiveDrop
error
2020-09-16 14:17:51 -07:00
Dylan MacKenzie
ed6c7efd87
Use enum for status of non-const ops
2020-09-16 14:17:51 -07:00
mark
9e5f7d5631
mv compiler to compiler/
2020-08-30 18:45:07 +03:00