dtolnay/cxx

Permissibility heuristics for signatures involving lifetimes

Aberta

#165 aberto em 28 de abr. de 2020

 (0 comentário) (0 reação) (0 responsável)Rust (253 forks)batch import
help wanted

Métricas do repositório

Stars
 (4.472 estrelas)
Métricas de merge de PR
 (Mesclagem média 8m) (3 fundiu PRs em 30d)

Description

As motivated in https://github.com/dtolnay/cxx/issues/122#issuecomment-615372359, it may be nice to permit a signature like fn(&mut CThing, &str) -> &mut CThingChild even though we don't support explicit lifetime specifications in full generality. In that signature it's obvious the output mutable reference isn't going to be borrowed from inside the contents of the const &str, and it would be a big red flag in the C++ code if it were, so this is fine to allow.

Guia do colaborador