Change:
As of rustc 1.43.0-nightly ( 2020-03-15) the Travis CI builds of are failing due to rustc crashing. The crash happens when building the crate, which is a dependency of one of quiche's subcrates. Unfortunately I wasn't able to reproduce this locally, so I can't try the latest master or try to prepare a minimal reproducer, but I can reproduce this realiably on Travis CI, see e.g. https://travis- https://travis- https://travis- https://travis- Could this have something to do with Travis CI specifically? As per above, I don't have specific code that reproduces this. I can only reproduce when building the crate as part of quiche on Travis CI. : <details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
FTR, the docopt crate was last updated almost a year ago, so this is not due to some new code there
Let's see if we can shrink the input to something suitable for a regression test. ping cleanup Also cc
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good "Cleanup ICE-breaking candidate". In case it's useful, here are some [instructions] for tackling these sorts of bugs. Maybe take a look? Thanks! <3 [instructions]: https://rustc-dev- cc
This seems to be an issue with It could be we're calling with something that isn't an HIR owner, in which case it should be changed to return instead of panicking. It's odd that it can't be reproduced though.
I can reproduce it by on
I just realized I wasn't actually using rust nightly when I tried to reproduce locally :man_facepalming: so that explains that...
Minimized:
assign

Discussion:
} fn find_entry(&self, id: HirId) -> Option<Entry<'hir>> { <del> Some(self.get_entry(id)) } fn get_entry(&self, id: HirId) -> Entry<'hir> { </del> if id.local_id == ItemLocalId::from_u32(0) { let owner = self.tcx.hir_owner(id.owner); <del> Entry { parent: owner.parent, node: owner.node } </del> <ins> owner.map(|owner| Entry { parent: owner.parent, node: owner.node }) </ins> } else { let owner = self.tcx.hir_owner_nodes(id.owner); <del> let node = owner.nodes[id.local_id].as_ref().unwrap(); // FIXME(eddyb) use a single generic type insted of having both // `Entry` and `ParentedNode`, which are effectively the same. // Alternatively, rewrite code using `Entry` to use `ParentedNode`. Entry { parent: HirId { owner: id.owner, local_id: node.parent }, node: node.node } </del> <ins> owner.and_then(|owner| { let node = owner.nodes[id.local_id].as_ref(); // FIXME(eddyb) use a single generic type insted of having both // `Entry` and `ParentedNode`, which are effectively the same. // Alternatively, rewrite code using `Entry` to use `ParentedNode`. node.map(|node| Entry { parent: HirId { owner: id.owner, local_id: node.parent }, node: node.node, }) }) </ins> } } <ins> fn get_entry(&self, id: HirId) -> Entry<'hir> { self.find_entry(id).unwrap() } </ins> pub fn item(&self, id: HirId) -> &'hir Item<'hir> { match self.find(id).unwrap() { Node::Item(item) => item,

} pub fn body(&self, id: BodyId) -> &'hir Body<'hir> { <del> self.tcx.hir_owner_nodes(id.hir_id.owner).bodies.get(&id.hir_id.local_id).unwrap() </del> <ins> self.tcx.hir_owner_nodes(id.hir_id.owner).unwrap().bodies.get(&id.hir_id.local_id).unwrap() </ins> } pub fn fn_decl_by_hir_id(&self, hir_id: HirId) -> Option<&'hir FnDecl<'hir>> {

/// Retrieves the `Node` corresponding to `id`, returning `None` if cannot be found. pub fn find(&self, hir_id: HirId) -> Option<Node<'hir>> { <del> let node = self.get_entry(hir_id).node; if let Node::Crate(..) = node { None } else { Some(node) } </del> <ins> self.find_entry(hir_id).and_then(|entry| { if let Node::Crate(..) = entry.node { None } else { Some(entry.node) } }) </ins> } /// Similar to `get_parent`; returns the parent HIR Id, or just `hir_id` if there

let module = hir.as_local_hir_id(id.to_def_id()).unwrap(); &tcx.untracked_crate.modules[&module] }; <del> providers.hir_owner = |tcx, id| tcx.index_hir(LOCAL_CRATE).map[id].signature.unwrap(); providers.hir_owner_nodes = |tcx, id| { tcx.index_hir(LOCAL_CRATE).map[id].with_bodies.as_ref().map(|nodes| &**nodes).unwrap() }; </del> <ins> providers.hir_owner = |tcx, id| tcx.index_hir(LOCAL_CRATE).map[id].signature; providers.hir_owner_nodes = |tcx, id| tcx.index_hir(LOCAL_CRATE).map[id].with_bodies.as_ref().map(|nodes| &**nodes); </ins> map::provide(providers); }

// // This can be conveniently accessed by methods on `tcx.hir()`. // Avoid calling this query directly. <del> query hir_owner(key: LocalDefId) -> &'tcx crate::hir::Owner<'tcx> { </del> <ins> query hir_owner(key: LocalDefId) -> Option<&'tcx crate::hir::Owner<'tcx>> { </ins> eval_always desc { |tcx| "HIR owner of `{}`", tcx.def_path_str(key.to_def_id()) } }

// // This can be conveniently accessed by methods on `tcx.hir()`. // Avoid calling this query directly. <del> query hir_owner_nodes(key: LocalDefId) -> &'tcx crate::hir::OwnerNodes<'tcx> { </del> <ins> query hir_owner_nodes(key: LocalDefId) -> Option<&'tcx crate::hir::OwnerNodes<'tcx>> { </ins> eval_always desc { |tcx| "HIR owner items in `{}`", tcx.def_path_str(key.to_def_id()) } }

<ins> // compile-flags: --edition=2018 // run-pass macro_rules! regex { //~^ WARN unused macro definition () => {}; } #[allow(dead_code)] use regex; //~^ WARN unused import fn main() {} </ins>

<ins> warning: unused macro definition --> $DIR/issue-70041.rs:4:1 | LL | / macro_rules! regex { LL | | LL | |     () => {}; LL | | } | |_^ | = note: `#[warn(unused_macros)]` on by default warning: unused import: `regex` --> $DIR/issue-70041.rs:10:5 | LL | use regex; |     ^^^^^ | = note: `#[warn(unused_imports)]` on by default </ins>