-
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
ICE: stack overflow using imported type in Fn/FnMut across three crates #61711
Comments
pre-triage: P-high, removing nomination tag. assigning to self for initial investigation. |
(seems to me like the ((but the |
Here is a shell script to compile the files using #!/bin/bash
set -e
mkdir -p build
FLAGS="--edition=2018 --out-dir build --emit=dep-info,link -L dependency=./build --extern a=./build/liba.rlib --extern b=./buil\
d/libb.rlib "
# RUSTC=rustc
RUSTC=./rust-61711/objdir-dbgopt/build/x86_64-unknown-linux-gnu/stage1/bin/rustc
echo "Building a.rs"
$RUSTC --crate-name a a.rs --crate-type lib $FLAGS
echo "Building b.rs"
$RUSTC --crate-name b b.rs --crate-type lib $FLAGS
echo "Building c.rs"
gdb --args $RUSTC --crate-name c c.rs --crate-type bin $FLAGS |
and the backtrace from
(and so on, for at least 15,000 stack frames...) |
(prior to rust 1.35.0, it seems like we might have infinite looped here with no stack overflow. Not 100% sure of that yet; and this test case currently relies on 2018 edition, so its not easy to go back to earlier than 1.31.0) |
Also, you can inline the contents of crate a into crate b and preserve the erroneous behavior: // b.rs
#![crate_type="lib"]
pub struct Struct;
pub use crate as alias; // c.rs
fn f<F: Fn(b::Struct)>(_: F) { }
fn main() { } |
Okay I think I have a solution for this. Hope to post PR today or tomorrow. |
…ath, r=eddyb Dont recur infinitely from print_def_path Fix #61711
I have three crates:
a
(library),b
(library), andc
(binary).a
has no dependencies, and itssrc/lib.rs
is just:b
has the following dependency andsrc/lib.rs
:c
has the following dependency andsrc/main.rs
:The following error happens running
cargo check
orcargo build
in cratec
:Try as I may, I can't manage to make the error happen without putting in every one of those lines and dependencies.
EDIT: the bug only requires
crate as alias
, notcrate::{self as alias}
The text was updated successfully, but these errors were encountered: