Skip to content

Commit b72d226

Browse files
committed
fix examples for rustc 1.68.0-nightly (935dc0721 2022-12-19) (rust-lang#1556)
1 parent 0dc2b03 commit b72d226

3 files changed

+5
-11
lines changed

examples/rustc-driver-example.rs

+1-2
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.62.0-nightly (7c4b47696 2022-04-30)
6+
// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
77

88
extern crate rustc_error_codes;
99
extern crate rustc_errors;
@@ -50,7 +50,6 @@ fn main() {
5050
output_dir: None, // Option<PathBuf>
5151
output_file: None, // Option<PathBuf>
5252
file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>>
53-
diagnostic_output: rustc_session::DiagnosticOutput::Default,
5453
lint_caps: FxHashMap::default(), // FxHashMap<lint::LintId, lint::Level>
5554
// This is a callback from the driver that is called when [`ParseSess`] is created.
5655
parse_sess_created: None, //Option<Box<dyn FnOnce(&mut ParseSess) + Send>>

examples/rustc-driver-getting-diagnostics.rs

+2-6
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.62.0-nightly (7c4b47696 2022-04-30)
6+
// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
77

88
extern crate rustc_error_codes;
99
extern crate rustc_errors;
@@ -64,11 +64,7 @@ fn main() {
6464
}
6565
"
6666
.into(),
67-
},
68-
// Redirect the diagnostic output of the compiler to a buffer.
69-
diagnostic_output: rustc_session::DiagnosticOutput::Raw(Box::from(DiagnosticSink(
70-
buffer.clone(),
71-
))),
67+
},
7268
crate_cfg: rustc_hash::FxHashSet::default(),
7369
crate_check_cfg: CheckCfg::default(),
7470
input_path: None,

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

+2-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.62.0-nightly (7c4b47696 2022-04-30)
6+
// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
77

88
extern crate rustc_ast_pretty;
99
extern crate rustc_error_codes;
@@ -42,8 +42,7 @@ fn main() {
4242
}
4343
"#
4444
.to_string(),
45-
},
46-
diagnostic_output: rustc_session::DiagnosticOutput::Default,
45+
},
4746
crate_cfg: rustc_hash::FxHashSet::default(),
4847
crate_check_cfg: CheckCfg::default(),
4948
input_path: None,

0 commit comments

Comments
 (0)