Skip to content

Commit fbda644

Browse files
ujjawal4046Ujjawal Kumar
and
Ujjawal Kumar
authored
Update examples with 1.61.0-nightly (latest version) (#1330)
Co-authored-by: Ujjawal Kumar <[email protected]>
1 parent 664d3c7 commit fbda644

3 files changed

+9
-10
lines changed

examples/rustc-driver-example.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// NOTE: For the example to compile, you will need to first run the following:
44
// rustup component add rustc-dev
55

6-
// version: 1.53.0-nightly (9b0edb7fd 2021-03-27)
6+
// version: 1.61.0-nightly (68369a041 2022-02-22)
77

88
extern crate rustc_error_codes;
99
extern crate rustc_errors;
@@ -15,7 +15,7 @@ extern crate rustc_span;
1515

1616
use rustc_errors::registry;
1717
use rustc_hash::{FxHashMap, FxHashSet};
18-
use rustc_session::config;
18+
use rustc_session::config::{self, CheckCfg};
1919
use rustc_span::source_map;
2020
use std::path;
2121
use std::process;
@@ -36,6 +36,7 @@ fn main() {
3636
},
3737
// cfg! configuration in addition to the default ones
3838
crate_cfg: FxHashSet::default(), // FxHashSet<(String, Option<String>)>
39+
crate_check_cfg: CheckCfg::default(), // CheckCfg
3940
input: config::Input::Str {
4041
name: source_map::FileName::Custom("main.rs".to_string()),
4142
input: "static HELLO: &str = \"Hello, world!\"; fn main() { println!(\"{}\", HELLO); }"
@@ -46,8 +47,6 @@ fn main() {
4647
output_file: None, // Option<PathBuf>
4748
file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>>
4849
diagnostic_output: rustc_session::DiagnosticOutput::Default,
49-
// Set to capture stderr output during compiler execution
50-
stderr: None, // Option<Arc<Mutex<Vec<u8>>>>
5150
lint_caps: FxHashMap::default(), // FxHashMap<lint::LintId, lint::Level>
5251
// This is a callback from the driver that is called when [`ParseSess`] is created.
5352
parse_sess_created: None, //Option<Box<dyn FnOnce(&mut ParseSess) + Send>>

examples/rustc-driver-getting-diagnostics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// NOTE: For the example to compile, you will need to first run the following:
44
// rustup component add rustc-dev
55

6-
// version: 1.53.0-nightly (9b0edb7fd 2021-03-27)
6+
// version: 1.61.0-nightly (68369a041 2022-02-22)
77

88
extern crate rustc_error_codes;
99
extern crate rustc_errors;
@@ -14,7 +14,7 @@ extern crate rustc_session;
1414
extern crate rustc_span;
1515

1616
use rustc_errors::registry;
17-
use rustc_session::config;
17+
use rustc_session::config::{self, CheckCfg};
1818
use rustc_span::source_map;
1919
use std::io;
2020
use std::path;
@@ -65,11 +65,11 @@ fn main() {
6565
buffer.clone(),
6666
))),
6767
crate_cfg: rustc_hash::FxHashSet::default(),
68+
crate_check_cfg: CheckCfg::default(),
6869
input_path: None,
6970
output_dir: None,
7071
output_file: None,
7172
file_loader: None,
72-
stderr: None,
7373
lint_caps: rustc_hash::FxHashMap::default(),
7474
parse_sess_created: None,
7575
register_lints: None,

examples/rustc-driver-interacting-with-the-ast.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// NOTE: For the example to compile, you will need to first run the following:
44
// rustup component add rustc-dev llvm-tools-preview
55

6-
// version: 1.53.0-nightly (9b0edb7fd 2021-03-27)
6+
// version: 1.61.0-nightly (68369a041 2022-02-22)
77

88
extern crate rustc_ast_pretty;
99
extern crate rustc_error_codes;
@@ -16,7 +16,7 @@ extern crate rustc_span;
1616

1717
use rustc_ast_pretty::pprust::item_to_string;
1818
use rustc_errors::registry;
19-
use rustc_session::config;
19+
use rustc_session::config::{self, CheckCfg};
2020
use rustc_span::source_map;
2121
use std::path;
2222
use std::process;
@@ -41,11 +41,11 @@ fn main() {
4141
},
4242
diagnostic_output: rustc_session::DiagnosticOutput::Default,
4343
crate_cfg: rustc_hash::FxHashSet::default(),
44+
crate_check_cfg: CheckCfg::default(),
4445
input_path: None,
4546
output_dir: None,
4647
output_file: None,
4748
file_loader: None,
48-
stderr: None,
4949
lint_caps: rustc_hash::FxHashMap::default(),
5050
parse_sess_created: None,
5151
register_lints: None,

0 commit comments

Comments
 (0)