-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
rustc panic due to reference passed instead of mut reference #61623
Labels
A-NLL
Area: Non-lexical lifetimes (NLL)
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-high
High priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
jonas-schievink
added
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
I-nominated
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
A-NLL
Area: Non-lexical lifetimes (NLL)
labels
Jun 7, 2019
Reduction: fn f1<'a>(_: &'a mut ()) {}
fn f2<P>(_: P, _: ()) {}
fn f3<'a>(x: &'a ((), &'a mut ())) {
f2(|| x.0, f1(x.1))
} |
Centril
added
the
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
label
Jun 7, 2019
The issue is here: rust/src/librustc_mir/borrow_check/mod.rs Line 1075 in c1c60d2
if Another couple of test cases: fn f1<'a>(_: &'a mut ()) {}
unsafe fn f3<'a>(x: *mut ((), &'a mut ())) {
(&x, f1((*x).1));
} trait A {
fn f1<'a>(&'a mut self) {}
}
impl<T> A for T {}
unsafe fn f3<'a>(x: *mut ()) {
(&x, (*x).f1());
} |
triage: P-high, assigning to @matthewjasper , removing I-nominated label. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-NLL
Area: Non-lexical lifetimes (NLL)
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-high
High priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code causes a panic in rustc nightly and stable 2018 Edition:
I do not expect this to compile, as get_tree requires a mut reference, which is not provided by get. When changing get_tree to
fn get_tree(&self) -> &Tree;
, the code compiles properly.Backtrace
The text was updated successfully, but these errors were encountered: