-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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' panicked at 'already borrowed: BorrowMutError' #41053
Comments
Minimal example: pub trait Trait { fn foo(&self) {} }
pub struct Foo;
impl Iterator for Foo {
type Item = ();
fn next(&mut self) -> Option<()> {
extern crate bar;
impl ::Trait for bar::S {
fn foo(&self) {}
}
None
}
} bar.rs #![crate_type="rlib"]
pub struct S; |
arielb1
added a commit
to arielb1/rust
that referenced
this issue
Apr 4, 2017
Thanks @arielb1, that was a quick fix. |
The ICE occurs when you have an item referenced in an impl signature is imported from an To work around the ICE, you can move the call to |
Got it, it works 👍, thanks! |
icorderi
added a commit
to icorderi/tokio-jsonrpc
that referenced
this issue
Apr 4, 2017
- see rust issue (rust-lang/rust#41053)
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Apr 7, 2017
cstore: return an immutable borrow from `visible_parent_map` This prevents an ICE when `visible_parent_map` is called multiple times, for example when an item referenced in an impl signature is imported from an `extern crate` statement occurs within an impl. Fixes rust-lang#41053. r? @eddyb
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Apr 7, 2017
cstore: return an immutable borrow from `visible_parent_map` This prevents an ICE when `visible_parent_map` is called multiple times, for example when an item referenced in an impl signature is imported from an `extern crate` statement occurs within an impl. Fixes rust-lang#41053. r? @eddyb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was going through some refactoring and the compiler exploded. No unsafe.
The last bits of code I was playing with can be found here, before I tried to refactor the example, the tests were building and passing.
The macro that might be to blame is here.
I tried this code:
I parked a branch with the code that made it blew up, you can find it here
cargo build
works,cargo test
blows up.I expected to see this happen:
a happy compiler, worst case an unhappy one
Instead, this happened:
a dead compiler
Meta
rustc --version --verbose
:Backtrace:
The text was updated successfully, but these errors were encountered: