rustc-ap-rustc_errors 529.0.0

Automatically published version of the package `rustc_errors` in the rust-lang/rust repository from commit 4b65a86ebace8600c8e269e8bfe3365cdc460e68 The publishing script for this crate lives at: https://github.com/alexcrichton/rustc-auto-publish
Documentation
use rustc_data_structures::fx::FxHashMap;

#[derive(Clone)]
pub struct Registry {
    descriptions: FxHashMap<&'static str, &'static str>,
}

impl Registry {
    pub fn new(descriptions: &[(&'static str, &'static str)]) -> Registry {
        Registry { descriptions: descriptions.iter().cloned().collect() }
    }

    pub fn find_description(&self, code: &str) -> Option<&'static str> {
        self.descriptions.get(code).cloned()
    }
}