-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Latest nightly (rustc 1.64.0-nightly (62b272d25 2022-07-21)
) introduces a new borrowcheck error in previously compiling mdbook
0.4.20
#99591
Comments
Ran a bisection in Looks to be a rollup, #99567. None of them jump out as obvious candidates. searched nightlies: from nightly-2022-07-20 to nightly-2022-07-22 bisected with cargo-bisect-rustc v0.6.1Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --start 2022-07-20 --end 2022-07-22 --preserve -- check |
This might actually be #99413 (so, a soundness fix.)? A btreemap is used in that bit of code, but it's talking about a RenderContext. |
Confirmed that it is caused by #99413. Here is a slightly smaller repro: #![allow(unused)]
use std::collections::BTreeMap;
use std::marker::PhantomData;
use std::rc::Rc;
fn main() {
let mut rc = RenderContext {
local_helpers: BTreeMap::new(),
};
foo(&mut rc);
}
#[derive(Clone)]
struct RenderContext<'rc> {
local_helpers: BTreeMap<String, Rc<dyn HelperDef + 'rc>>,
}
pub trait HelperDef {}
fn foo(rc: &mut RenderContext<'_>) {
let mut local_rc = rc.clone();
let local_ctx: BTreeMap<String, String> = BTreeMap::new();
render(&local_ctx, &mut local_rc);
}
fn render<'rc>(ctx: &'rc BTreeMap<String, String>, rc: &mut RenderContext<'rc>) {} I think the error here is correct and #99413 is a valid fix. It's just a consequence of how the lifetimes in the handlebars crate are defined that cause the error. |
Until the fix to
|
@rustbot label -regression-untriaged +regression-from-stable-to-stable |
@Jules-Bertholet changed the label to regression on stable: did you experience that it's still an issue? I've compiled |
I think this should be closed since it was an intentional soundness fix. |
As of
rustc 1.64.0-nightly (62b272d25 2022-07-21)
, a new lifetime error has appeared when attempting to buildmdbook
0.4.20
.Error
Version it worked on
rustc 1.64.0-nightly (d68e7eb 2022-07-20)
Version with regression
rustc 1.64.0-nightly (62b272d 2022-07-21)
Details
You can find more details at the downstream
mdbook
issue rust-lang/mdBook#1860.Curiously, the new error can be fixed by re-ordering some seemingly inocuous statements - see this PR rust-lang/mdBook#1861.
Perhaps this is indicative of an error in non-lexical-lifetime handling on the latest nightly? Or alternatively, this could be the result of fixing a soundness / safety issue related to the interop between lifetimes and drop order?
This error was originally discovered in an unrelated CI pass failing in the following PR: FuelLabs/sway#2359.
The text was updated successfully, but these errors were encountered: