about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhosseind75 <dindar95@bk.ru>2020-09-29 18:14:07 +0330
committerhosseind88 <hosseind88@mail.ru>2020-10-09 20:57:45 +0330
commit2124e9b50e2ba208700f1ab928e0863e407eb158 (patch)
tree232714785e2d1120bf8c9f91acd05d46945e4e82
parent15663a432d281749655916ac22eaca8248260551 (diff)
downloadrust-2124e9b50e2ba208700f1ab928e0863e407eb158.tar.gz
rust-2124e9b50e2ba208700f1ab928e0863e407eb158.zip
rebase with master
-rw-r--r--compiler/rustc_driver/src/lib.rs4
-rw-r--r--compiler/rustc_middle/src/ty/query/plumbing.rs8
-rw-r--r--src/tools/clippy/src/driver.rs4
3 files changed, 14 insertions, 2 deletions
diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs
index 177256008f8..a2c244d6f17 100644
--- a/compiler/rustc_driver/src/lib.rs
+++ b/compiler/rustc_driver/src/lib.rs
@@ -1214,7 +1214,9 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
     // If backtraces are enabled, also print the query stack
     let backtrace = env::var_os("RUST_BACKTRACE").map(|x| &x != "0").unwrap_or(false);
 
-    TyCtxt::try_print_query_stack(&handler, Some(2), Some(backtrace));
+    let num_frames = if backtrace { None } else { Some(2) };
+
+    TyCtxt::try_print_query_stack(&handler, num_frames);
 
     #[cfg(windows)]
     unsafe {
diff --git a/compiler/rustc_middle/src/ty/query/plumbing.rs b/compiler/rustc_middle/src/ty/query/plumbing.rs
index d5fbcf6c9b1..d64e32c4d36 100644
--- a/compiler/rustc_middle/src/ty/query/plumbing.rs
+++ b/compiler/rustc_middle/src/ty/query/plumbing.rs
@@ -124,11 +124,15 @@ impl<'tcx> TyCtxt<'tcx> {
         })
     }
 
+<<<<<<< HEAD
     pub fn try_print_query_stack(
         handler: &Handler,
         num_frames: Option<usize>,
         backtrace: Option<bool>,
     ) {
+=======
+    pub fn try_print_query_stack(handler: &Handler, num_frames: Option<usize>) {
+>>>>>>> 15827338aa231fd408561bf5db8d8eea85d1a51a
         eprintln!("query stack during panic:");
 
         // Be careful reyling on global state here: this code is called from
@@ -142,7 +146,11 @@ impl<'tcx> TyCtxt<'tcx> {
                 let mut i = 0;
 
                 while let Some(query) = current_query {
+<<<<<<< HEAD
                     if backtrace.unwrap() == false && i == num_frames.unwrap() {
+=======
+                    if num_frames == Some(i) {
+>>>>>>> 15827338aa231fd408561bf5db8d8eea85d1a51a
                         break;
                     }
                     let query_info =
diff --git a/src/tools/clippy/src/driver.rs b/src/tools/clippy/src/driver.rs
index 0b324775b0d..bf9110b4349 100644
--- a/src/tools/clippy/src/driver.rs
+++ b/src/tools/clippy/src/driver.rs
@@ -277,7 +277,9 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
     // If backtraces are enabled, also print the query stack
     let backtrace = env::var_os("RUST_BACKTRACE").map_or(false, |x| &x != "0");
 
-    TyCtxt::try_print_query_stack(&handler, Some(2), Some(backtrace));
+    let num_frames = if backtrace { None } else { Some(2) };
+
+    TyCtxt::try_print_query_stack(&handler, num_frames);
 }
 
 fn toolchain_path(home: Option<String>, toolchain: Option<String>) -> Option<PathBuf> {