Skip to content

Commit a771557

Browse files
committed
Auto merge of #6178 - josephlr:sync-from-rust, r=phansch
Sync from rust Fix rustc breakage by running: ```rust git subtree push -P src/tools/clippy [email protected]:josephlr/rust-clippy sync-from-rust ``` and then adding a commit that runs `cargo dev fmt` --- changelog: none
2 parents 0cba5e6 + ef91de6 commit a771557

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

clippy_lints/src/trivially_copy_pass_by_ref.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use rustc_hir::intravisit::FnKind;
99
use rustc_hir::{Body, FnDecl, HirId, ItemKind, MutTy, Mutability, Node};
1010
use rustc_lint::{LateContext, LateLintPass};
1111
use rustc_middle::ty;
12-
use rustc_session::config::Config as SessionConfig;
1312
use rustc_session::{declare_tool_lint, impl_lint_pass};
1413
use rustc_span::Span;
1514
use rustc_target::abi::LayoutOf;
1615
use rustc_target::spec::abi::Abi;
16+
use rustc_target::spec::Target;
1717

1818
declare_clippy_lint! {
1919
/// **What it does:** Checks for functions taking arguments by reference, where
@@ -60,9 +60,9 @@ pub struct TriviallyCopyPassByRef {
6060
}
6161

6262
impl<'tcx> TriviallyCopyPassByRef {
63-
pub fn new(limit: Option<u64>, target: &SessionConfig) -> Self {
63+
pub fn new(limit: Option<u64>, target: &Target) -> Self {
6464
let limit = limit.unwrap_or_else(|| {
65-
let bit_width = u64::from(target.ptr_width);
65+
let bit_width = u64::from(target.pointer_width);
6666
// Cap the calculated bit width at 32-bits to reduce
6767
// portability problems between 32 and 64-bit targets
6868
let bit_width = cmp::min(bit_width, 32);

src/driver.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
276276
// If backtraces are enabled, also print the query stack
277277
let backtrace = env::var_os("RUST_BACKTRACE").map_or(false, |x| &x != "0");
278278

279-
if backtrace {
280-
TyCtxt::try_print_query_stack(&handler);
281-
}
279+
let num_frames = if backtrace { None } else { Some(2) };
280+
281+
TyCtxt::try_print_query_stack(&handler, num_frames);
282282
}
283283

284284
fn toolchain_path(home: Option<String>, toolchain: Option<String>) -> Option<PathBuf> {

tests/ui/custom_ice_message.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy
99

1010
note: Clippy version: foo
1111

12+
query stack during panic:
13+
end of query stack

0 commit comments

Comments
 (0)