]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/rustfmt/src/config/config_type.rs
Rollup merge of #98479 - leocth:atomic-bool-fetch-not, r=joshtriplett
[rust.git] / src / tools / rustfmt / src / config / config_type.rs
index 7fc4486ddcd3df0a0850262b89ee48fdb87bbe96..e37ed798cb55985943b58dd1d6ec69a79e610801 100644 (file)
@@ -61,9 +61,6 @@ macro_rules! create_config {
         #[derive(Clone)]
         #[allow(unreachable_pub)]
         pub struct Config {
-            // if a license_template_path has been specified, successfully read, parsed and compiled
-            // into a regex, it will be stored here
-            pub license_template: Option<Regex>,
             // For each config item, we store a bool indicating whether it has
             // been accessed and the value, and a bool whether the option was
             // manually initialised, or taken from the default,
@@ -104,7 +101,6 @@ pub fn $i(&mut self, value: $ty) {
                     | "struct_variant_width"
                     | "array_width"
                     | "chain_width" => self.0.set_heuristics(),
-                    "license_template_path" => self.0.set_license_template(),
                     "merge_imports" => self.0.set_merge_imports(),
                     &_ => (),
                 }
@@ -163,7 +159,6 @@ fn fill_from_parsed_config(mut self, parsed: PartialConfig, dir: &Path) -> Confi
                 }
             )+
                 self.set_heuristics();
-                self.set_license_template();
                 self.set_ignore(dir);
                 self.set_merge_imports();
                 self
@@ -247,7 +242,6 @@ pub fn override_value(&mut self, key: &str, val: &str)
                     | "struct_variant_width"
                     | "array_width"
                     | "chain_width" => self.set_heuristics(),
-                    "license_template_path" => self.set_license_template(),
                     "merge_imports" => self.set_merge_imports(),
                     &_ => (),
                 }
@@ -386,21 +380,6 @@ fn set_heuristics(&mut self) {
                 };
             }
 
-            fn set_license_template(&mut self) {
-                if self.was_set().license_template_path() {
-                    let lt_path = self.license_template_path();
-                    if lt_path.len() > 0 {
-                        match license::load_and_compile_template(&lt_path) {
-                            Ok(re) => self.license_template = Some(re),
-                            Err(msg) => eprintln!("Warning for license template file {:?}: {}",
-                                                lt_path, msg),
-                        }
-                    } else {
-                        self.license_template = None;
-                    }
-                }
-            }
-
             fn set_ignore(&mut self, dir: &Path) {
                 self.ignore.2.add_prefix(dir);
             }
@@ -437,7 +416,6 @@ pub fn is_default(&self, key: &str) -> bool {
         impl Default for Config {
             fn default() -> Config {
                 Config {
-                    license_template: None,
                     $(
                         $i: (Cell::new(false), false, $def, $stb),
                     )+