-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
from-craterA regression found via a crater run, not part of our test suiteA regression found via a crater run, not part of our test suite
Description
#![recursion_limit = "8"]
fn main() {
let _: Box<dyn Send> = Box::new(&&&&&&&1);
}
results in
error: internal compiler error: errors selecting obligation during MIR typeck: query type op DefId(0:7 ~ main[c42f]::main) [Ambiguity]
|
= note: delayed at /home/lcnr/rust/compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs:105:18 - disabled backtrace
HIR typeck uses a custom select loop to coerce https://github.com/rust-lang/rust/blob/ae12bc21d8ec76bbb753d4da168e9b08e1b09ebf/compiler/rustc_hir_typeck/src/coercion.rs#L664-L771
MIR type check just prove CoerceUnsized
directly https://github.com/rust-lang/rust/blob/ae12bc21d8ec76bbb753d4da168e9b08e1b09ebf/compiler/rustc_borrowck/src/type_check/mod.rs#L1227-L1244
Generally, to handle non-fatal overflow, MIR borrowck always has to prove the same goals as HIR typeck at the same depth. This is a problem with the new solver due to 2 reasons:
- we don't use the
recursion_depth
ofObligation
s as the available dpeth in the trait solver, only for errors in the fulfillment loop - our overflow is actually non-fatal
This is kinda yikes
Metadata
Metadata
Assignees
Labels
from-craterA regression found via a crater run, not part of our test suiteA regression found via a crater run, not part of our test suite
Type
Projects
Status
todo