-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing owned_box
error message since nightly-2019-09-04
#64430
Comments
I'm testing this with cargo-bisect-rustc |
cc @estebank -- I think we need to be more graceful by checking if liballoc exists or not or not requiring the language items. |
PR #64056 fix #62373, show more suggestions on method take if let Some(mut err) = self.report_method_error(
span,
rcvr_t,
segment.ident,
SelfSource::MethodCall(rcvr),
error,
Some(args),
) {
if let ty::Adt(..) = rcvr_t.sty {
// Try alternative arbitrary self types that could fulfill this call.
// FIXME: probe for all types that *could* be arbitrary self-types, not
// just this whitelist.
let box_rcvr_t = self.tcx.mk_box(rcvr_t);
try_alt_rcvr(&mut err, box_rcvr_t);
let pin_rcvr_t = self.tcx.mk_lang_item(
rcvr_t,
lang_items::PinTypeLangItem,
);
try_alt_rcvr(&mut err, pin_rcvr_t);
let arc_rcvr_t = self.tcx.mk_lang_item(rcvr_t, lang_items::Arc);
try_alt_rcvr(&mut err, arc_rcvr_t);
let rc_rcvr_t = self.tcx.mk_lang_item(rcvr_t, lang_items::Rc);
try_alt_rcvr(&mut err, rc_rcvr_t);
}
err.emit();
} However, #![no_std]
extern crate alloc;
fn main() {
pub struct Writer;
write!(Writer, "");
} Error message of this code:
|
Mentoring instructions:
|
fix rust-lang#64430, confusing `owned_box` error message in no_std build Fixes rust-lang#64430
fix rust-lang#64430, confusing `owned_box` error message in no_std build Fixes rust-lang#64430
fix rust-lang#64430, confusing `owned_box` error message in no_std build Fixes rust-lang#64430
Rollup of 17 pull requests Successful merges: - #63846 (Added table containing the system calls used by Instant and SystemTime.) - #64116 (Fix minor typo in docs.) - #64203 (A few cosmetic improvements to code & comments in liballoc and libcore) - #64302 (Shrink `ObligationCauseCode`) - #64372 (use randSecure and randABytes) - #64374 (Box `DiagnosticBuilder`.) - #64375 (Fast path for vec.clear/truncate ) - #64378 (Fix inconsistent link formatting.) - #64384 (Trim rustc-workspace-hack) - #64393 ( declare EnvKey before use to fix build error) - #64420 (Inline `mark_neighbours_as_waiting_from`.) - #64422 (Remove raw string literal quotes from error index descriptions) - #64423 (Add self to .mailmap) - #64425 (typo fix) - #64431 (fn ptr is structural match) - #64435 (codegen: use "_N" (like for other locals) instead of "argN", for argument names.) - #64439 (fix #64430, confusing `owned_box` error message in no_std build) Failed merges: r? @ghost
Test Program:
Error message on nightly [9af1775 2019-09-02] and before:
Error message since nightly [b9de4ef 2019-09-03]:
Diff Between the Nightlies: 9af1775...b9de4ef
Reported by @wgfm and @ambye85 in phil-opp/blog_os#405 (comment).
The text was updated successfully, but these errors were encountered: