From deb3c8c0ee6942b41a5c3ef3939bba349bbae9a3 Mon Sep 17 00:00:00 2001
From: Ujjawal Kumar <u.kumar@ukumar-ltmit1s.internal.salesforce.com>
Date: Wed, 30 Mar 2022 19:34:47 +0530
Subject: [PATCH] Update examples with 1.61.0-nightly

---
 examples/rustc-driver-example.rs                  | 7 +++----
 examples/rustc-driver-getting-diagnostics.rs      | 6 +++---
 examples/rustc-driver-interacting-with-the-ast.rs | 6 +++---
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/examples/rustc-driver-example.rs b/examples/rustc-driver-example.rs
index 29fa24784..7177a2868 100644
--- a/examples/rustc-driver-example.rs
+++ b/examples/rustc-driver-example.rs
@@ -3,7 +3,7 @@
 // NOTE: For the example to compile, you will need to first run the following:
 //   rustup component add rustc-dev
 
-// version: 1.53.0-nightly (9b0edb7fd 2021-03-27)
+// version: 1.61.0-nightly (68369a041 2022-02-22)
 
 extern crate rustc_error_codes;
 extern crate rustc_errors;
@@ -15,7 +15,7 @@ extern crate rustc_span;
 
 use rustc_errors::registry;
 use rustc_hash::{FxHashMap, FxHashSet};
-use rustc_session::config;
+use rustc_session::config::{self, CheckCfg};
 use rustc_span::source_map;
 use std::path;
 use std::process;
@@ -36,6 +36,7 @@ fn main() {
         },
         // cfg! configuration in addition to the default ones
         crate_cfg: FxHashSet::default(), // FxHashSet<(String, Option<String>)>
+        crate_check_cfg: CheckCfg::default(), // CheckCfg
         input: config::Input::Str {
             name: source_map::FileName::Custom("main.rs".to_string()),
             input: "static HELLO: &str = \"Hello, world!\"; fn main() { println!(\"{}\", HELLO); }"
@@ -46,8 +47,6 @@ fn main() {
         output_file: None, // Option<PathBuf>
         file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>>
         diagnostic_output: rustc_session::DiagnosticOutput::Default,
-        // Set to capture stderr output during compiler execution
-        stderr: None,                    // Option<Arc<Mutex<Vec<u8>>>>
         lint_caps: FxHashMap::default(), // FxHashMap<lint::LintId, lint::Level>
         // This is a callback from the driver that is called when [`ParseSess`] is created.
         parse_sess_created: None, //Option<Box<dyn FnOnce(&mut ParseSess) + Send>>
diff --git a/examples/rustc-driver-getting-diagnostics.rs b/examples/rustc-driver-getting-diagnostics.rs
index d1b42658e..c25695dd0 100644
--- a/examples/rustc-driver-getting-diagnostics.rs
+++ b/examples/rustc-driver-getting-diagnostics.rs
@@ -3,7 +3,7 @@
 // NOTE: For the example to compile, you will need to first run the following:
 //   rustup component add rustc-dev
 
-// version: 1.53.0-nightly (9b0edb7fd 2021-03-27)
+// version: 1.61.0-nightly (68369a041 2022-02-22)
 
 extern crate rustc_error_codes;
 extern crate rustc_errors;
@@ -14,7 +14,7 @@ extern crate rustc_session;
 extern crate rustc_span;
 
 use rustc_errors::registry;
-use rustc_session::config;
+use rustc_session::config::{self, CheckCfg};
 use rustc_span::source_map;
 use std::io;
 use std::path;
@@ -65,11 +65,11 @@ fn main() {
             buffer.clone(),
         ))),
         crate_cfg: rustc_hash::FxHashSet::default(),
+        crate_check_cfg: CheckCfg::default(),
         input_path: None,
         output_dir: None,
         output_file: None,
         file_loader: None,
-        stderr: None,
         lint_caps: rustc_hash::FxHashMap::default(),
         parse_sess_created: None,
         register_lints: None,
diff --git a/examples/rustc-driver-interacting-with-the-ast.rs b/examples/rustc-driver-interacting-with-the-ast.rs
index cbf48c9ce..c942ac324 100644
--- a/examples/rustc-driver-interacting-with-the-ast.rs
+++ b/examples/rustc-driver-interacting-with-the-ast.rs
@@ -3,7 +3,7 @@
 // NOTE: For the example to compile, you will need to first run the following:
 //     rustup component add rustc-dev llvm-tools-preview
 
-// version: 1.53.0-nightly (9b0edb7fd 2021-03-27)
+// version: 1.61.0-nightly (68369a041 2022-02-22)
 
 extern crate rustc_ast_pretty;
 extern crate rustc_error_codes;
@@ -16,7 +16,7 @@ extern crate rustc_span;
 
 use rustc_ast_pretty::pprust::item_to_string;
 use rustc_errors::registry;
-use rustc_session::config;
+use rustc_session::config::{self, CheckCfg};
 use rustc_span::source_map;
 use std::path;
 use std::process;
@@ -41,11 +41,11 @@ fn main() {
         },
         diagnostic_output: rustc_session::DiagnosticOutput::Default,
         crate_cfg: rustc_hash::FxHashSet::default(),
+        crate_check_cfg: CheckCfg::default(),
         input_path: None,
         output_dir: None,
         output_file: None,
         file_loader: None,
-        stderr: None,
         lint_caps: rustc_hash::FxHashMap::default(),
         parse_sess_created: None,
         register_lints: None,