Skip to content

Commit c802135

Browse files
author
Nick Hamann
committed
Add error explanation for E0066.
This also updates the error message to remove mention of "managed heap", which was removed in 8a91d33.
1 parent 4b52059 commit c802135

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,8 +3033,8 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
30333033
let mut checked = false;
30343034
opt_place.as_ref().map(|place| match place.node {
30353035
ast::ExprPath(None, ref path) => {
3036-
// FIXME(pcwalton): For now we hardcode the two permissible
3037-
// places: the exchange heap and the managed heap.
3036+
// FIXME(pcwalton): For now we hardcode the only permissible
3037+
// place: the exchange heap.
30383038
let definition = lookup_full_def(tcx, path.span, place.id);
30393039
let def_id = definition.def_id();
30403040
let referent_ty = fcx.expr_ty(&**subexpr);
@@ -3048,7 +3048,7 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
30483048

30493049
if !checked {
30503050
span_err!(tcx.sess, expr.span, E0066,
3051-
"only the managed heap and exchange heap are currently supported");
3051+
"only the exchange heap is currently supported");
30523052
fcx.write_ty(id, tcx.types.err);
30533053
}
30543054
}

src/librustc_typeck/diagnostics.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ enum variant, one of the fields was not provided. Each field should be specified
9191
exactly once.
9292
"##,
9393

94+
E0066: r##"
95+
Box placement expressions (like C++'s "placement new") do not support any
96+
place expression except the exchange heap (i.e. `std::boxed::HEAP`).
97+
Furthermore, the syntax is changing to use `in` instead of `box`. See [RFC
98+
470][rfc470] and [RFC 809][rfc809] for more details.
99+
100+
[rfc470]: https://github.com/rust-lang/rfcs/pull/470
101+
[rfc809]: https://github.com/rust-lang/rfcs/blob/master/text/0809-box-and-in-for-stdlib.md
102+
"##,
103+
94104
E0067: r##"
95105
The left-hand side of an assignment operator must be an lvalue expression. An
96106
lvalue expression represents a memory location and includes item paths (ie,
@@ -498,7 +508,6 @@ register_diagnostics! {
498508
E0059,
499509
E0060,
500510
E0061,
501-
E0066,
502511
E0068,
503512
E0070,
504513
E0071,

0 commit comments

Comments
 (0)