Auto merge of #134292 - matthiaskrgr:rollup-3kbjocl, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #134181 (Tweak multispan rendering to reduce output length) - #134209 (validate `--skip` and `--exclude` paths) - #134231 (rustdoc-search: fix mismatched path when parent re-exported twice) - #134236 (crashes: more tests v2) - #134240 (Only dist `llvm-objcopy` if llvm tools are enabled) - #134244 (rustc_borrowck: Stop suggesting the invalid syntax `&mut raw const`) - #134251 (A bunch of cleanups (part 2)) - #134256 (Use a more precise span in placeholder_type_error_diag) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
a1740a9c35
223 changed files with 568 additions and 957 deletions
|
@ -3507,7 +3507,6 @@ dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"either",
|
"either",
|
||||||
"itertools",
|
"itertools",
|
||||||
"jobserver",
|
|
||||||
"libc",
|
"libc",
|
||||||
"object 0.36.5",
|
"object 0.36.5",
|
||||||
"pathdiff",
|
"pathdiff",
|
||||||
|
|
|
@ -1100,12 +1100,12 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
|
||||||
}
|
}
|
||||||
let decl_span = local_decl.source_info.span;
|
let decl_span = local_decl.source_info.span;
|
||||||
|
|
||||||
let label = match *local_decl.local_info() {
|
let amp_mut_sugg = match *local_decl.local_info() {
|
||||||
LocalInfo::User(mir::BindingForm::ImplicitSelf(_)) => {
|
LocalInfo::User(mir::BindingForm::ImplicitSelf(_)) => {
|
||||||
let suggestion = suggest_ampmut_self(self.infcx.tcx, decl_span);
|
let suggestion = suggest_ampmut_self(self.infcx.tcx, decl_span);
|
||||||
let additional =
|
let additional =
|
||||||
local_trait.map(|span| (span, suggest_ampmut_self(self.infcx.tcx, span)));
|
local_trait.map(|span| (span, suggest_ampmut_self(self.infcx.tcx, span)));
|
||||||
Some((true, decl_span, suggestion, additional))
|
Some(AmpMutSugg { has_sugg: true, span: decl_span, suggestion, additional })
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
|
LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
|
||||||
|
@ -1150,7 +1150,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
let (has_sugg, decl_span, sugg) = if name != kw::SelfLower {
|
if name != kw::SelfLower {
|
||||||
suggest_ampmut(
|
suggest_ampmut(
|
||||||
self.infcx.tcx,
|
self.infcx.tcx,
|
||||||
local_decl.ty,
|
local_decl.ty,
|
||||||
|
@ -1165,7 +1165,12 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
|
||||||
..
|
..
|
||||||
})) => {
|
})) => {
|
||||||
let sugg = suggest_ampmut_self(self.infcx.tcx, decl_span);
|
let sugg = suggest_ampmut_self(self.infcx.tcx, decl_span);
|
||||||
(true, decl_span, sugg)
|
Some(AmpMutSugg {
|
||||||
|
has_sugg: true,
|
||||||
|
span: decl_span,
|
||||||
|
suggestion: sugg,
|
||||||
|
additional: None,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// explicit self (eg `self: &'a Self`)
|
// explicit self (eg `self: &'a Self`)
|
||||||
_ => suggest_ampmut(
|
_ => suggest_ampmut(
|
||||||
|
@ -1176,8 +1181,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
|
||||||
opt_ty_info,
|
opt_ty_info,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
Some((has_sugg, decl_span, sugg, None))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1187,15 +1191,24 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
|
||||||
..
|
..
|
||||||
})) => {
|
})) => {
|
||||||
let pattern_span: Span = local_decl.source_info.span;
|
let pattern_span: Span = local_decl.source_info.span;
|
||||||
suggest_ref_mut(self.infcx.tcx, pattern_span)
|
suggest_ref_mut(self.infcx.tcx, pattern_span).map(|span| AmpMutSugg {
|
||||||
.map(|span| (true, span, "mut ".to_owned(), None))
|
has_sugg: true,
|
||||||
|
span,
|
||||||
|
suggestion: "mut ".to_owned(),
|
||||||
|
additional: None,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
match label {
|
match amp_mut_sugg {
|
||||||
Some((true, err_help_span, suggested_code, additional)) => {
|
Some(AmpMutSugg {
|
||||||
|
has_sugg: true,
|
||||||
|
span: err_help_span,
|
||||||
|
suggestion: suggested_code,
|
||||||
|
additional,
|
||||||
|
}) => {
|
||||||
let mut sugg = vec![(err_help_span, suggested_code)];
|
let mut sugg = vec![(err_help_span, suggested_code)];
|
||||||
if let Some(s) = additional {
|
if let Some(s) = additional {
|
||||||
sugg.push(s);
|
sugg.push(s);
|
||||||
|
@ -1217,7 +1230,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some((false, err_label_span, message, _)) => {
|
Some(AmpMutSugg {
|
||||||
|
has_sugg: false, span: err_label_span, suggestion: message, ..
|
||||||
|
}) => {
|
||||||
let def_id = self.body.source.def_id();
|
let def_id = self.body.source.def_id();
|
||||||
let hir_id = if let Some(local_def_id) = def_id.as_local()
|
let hir_id = if let Some(local_def_id) = def_id.as_local()
|
||||||
&& let Some(body) = self.infcx.tcx.hir().maybe_body_owned_by(local_def_id)
|
&& let Some(body) = self.infcx.tcx.hir().maybe_body_owned_by(local_def_id)
|
||||||
|
@ -1422,6 +1437,13 @@ fn suggest_ampmut_self<'tcx>(tcx: TyCtxt<'tcx>, span: Span) -> String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct AmpMutSugg {
|
||||||
|
has_sugg: bool,
|
||||||
|
span: Span,
|
||||||
|
suggestion: String,
|
||||||
|
additional: Option<(Span, String)>,
|
||||||
|
}
|
||||||
|
|
||||||
// When we want to suggest a user change a local variable to be a `&mut`, there
|
// When we want to suggest a user change a local variable to be a `&mut`, there
|
||||||
// are three potential "obvious" things to highlight:
|
// are three potential "obvious" things to highlight:
|
||||||
//
|
//
|
||||||
|
@ -1443,7 +1465,7 @@ fn suggest_ampmut<'tcx>(
|
||||||
decl_span: Span,
|
decl_span: Span,
|
||||||
opt_assignment_rhs_span: Option<Span>,
|
opt_assignment_rhs_span: Option<Span>,
|
||||||
opt_ty_info: Option<Span>,
|
opt_ty_info: Option<Span>,
|
||||||
) -> (bool, Span, String) {
|
) -> Option<AmpMutSugg> {
|
||||||
// if there is a RHS and it starts with a `&` from it, then check if it is
|
// if there is a RHS and it starts with a `&` from it, then check if it is
|
||||||
// mutable, and if not, put suggest putting `mut ` to make it mutable.
|
// mutable, and if not, put suggest putting `mut ` to make it mutable.
|
||||||
// we don't have to worry about lifetime annotations here because they are
|
// we don't have to worry about lifetime annotations here because they are
|
||||||
|
@ -1456,6 +1478,11 @@ fn suggest_ampmut<'tcx>(
|
||||||
&& let Ok(src) = tcx.sess.source_map().span_to_snippet(assignment_rhs_span)
|
&& let Ok(src) = tcx.sess.source_map().span_to_snippet(assignment_rhs_span)
|
||||||
&& let Some(stripped) = src.strip_prefix('&')
|
&& let Some(stripped) = src.strip_prefix('&')
|
||||||
{
|
{
|
||||||
|
let is_raw_ref = stripped.trim_start().starts_with("raw ");
|
||||||
|
// We don't support raw refs yet
|
||||||
|
if is_raw_ref {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
let is_mut = if let Some(rest) = stripped.trim_start().strip_prefix("mut") {
|
let is_mut = if let Some(rest) = stripped.trim_start().strip_prefix("mut") {
|
||||||
match rest.chars().next() {
|
match rest.chars().next() {
|
||||||
// e.g. `&mut x`
|
// e.g. `&mut x`
|
||||||
|
@ -1479,7 +1506,12 @@ fn suggest_ampmut<'tcx>(
|
||||||
|
|
||||||
// FIXME(Ezrashaw): returning is bad because we still might want to
|
// FIXME(Ezrashaw): returning is bad because we still might want to
|
||||||
// update the annotated type, see #106857.
|
// update the annotated type, see #106857.
|
||||||
return (true, span, "mut ".to_owned());
|
return Some(AmpMutSugg {
|
||||||
|
has_sugg: true,
|
||||||
|
span,
|
||||||
|
suggestion: "mut ".to_owned(),
|
||||||
|
additional: None,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1504,18 +1536,23 @@ fn suggest_ampmut<'tcx>(
|
||||||
&& let Some(ws_pos) = src.find(char::is_whitespace)
|
&& let Some(ws_pos) = src.find(char::is_whitespace)
|
||||||
{
|
{
|
||||||
let span = span.with_lo(span.lo() + BytePos(ws_pos as u32)).shrink_to_lo();
|
let span = span.with_lo(span.lo() + BytePos(ws_pos as u32)).shrink_to_lo();
|
||||||
(true, span, " mut".to_owned())
|
Some(AmpMutSugg { has_sugg: true, span, suggestion: " mut".to_owned(), additional: None })
|
||||||
// if there is already a binding, we modify it to be `mut`
|
// if there is already a binding, we modify it to be `mut`
|
||||||
} else if binding_exists {
|
} else if binding_exists {
|
||||||
// shrink the span to just after the `&` in `&variable`
|
// shrink the span to just after the `&` in `&variable`
|
||||||
let span = span.with_lo(span.lo() + BytePos(1)).shrink_to_lo();
|
let span = span.with_lo(span.lo() + BytePos(1)).shrink_to_lo();
|
||||||
(true, span, "mut ".to_owned())
|
Some(AmpMutSugg { has_sugg: true, span, suggestion: "mut ".to_owned(), additional: None })
|
||||||
} else {
|
} else {
|
||||||
// otherwise, suggest that the user annotates the binding; we provide the
|
// otherwise, suggest that the user annotates the binding; we provide the
|
||||||
// type of the local.
|
// type of the local.
|
||||||
let ty = decl_ty.builtin_deref(true).unwrap();
|
let ty = decl_ty.builtin_deref(true).unwrap();
|
||||||
|
|
||||||
(false, span, format!("{}mut {}", if decl_ty.is_ref() { "&" } else { "*" }, ty))
|
Some(AmpMutSugg {
|
||||||
|
has_sugg: false,
|
||||||
|
span,
|
||||||
|
suggestion: format!("{}mut {}", if decl_ty.is_ref() { "&" } else { "*" }, ty),
|
||||||
|
additional: None,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
use std::sync::{Arc, Condvar, Mutex};
|
use std::sync::{Arc, Condvar, Mutex};
|
||||||
|
|
||||||
use jobserver::HelperThread;
|
use rustc_data_structures::jobserver::{self, HelperThread};
|
||||||
use rustc_errors::DiagCtxtHandle;
|
use rustc_errors::DiagCtxtHandle;
|
||||||
use rustc_session::Session;
|
|
||||||
|
|
||||||
// FIXME don't panic when a worker thread panics
|
// FIXME don't panic when a worker thread panics
|
||||||
|
|
||||||
|
@ -14,14 +13,13 @@ pub(super) struct ConcurrencyLimiter {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ConcurrencyLimiter {
|
impl ConcurrencyLimiter {
|
||||||
pub(super) fn new(sess: &Session, pending_jobs: usize) -> Self {
|
pub(super) fn new(pending_jobs: usize) -> Self {
|
||||||
let state = Arc::new(Mutex::new(state::ConcurrencyLimiterState::new(pending_jobs)));
|
let state = Arc::new(Mutex::new(state::ConcurrencyLimiterState::new(pending_jobs)));
|
||||||
let available_token_condvar = Arc::new(Condvar::new());
|
let available_token_condvar = Arc::new(Condvar::new());
|
||||||
|
|
||||||
let state_helper = state.clone();
|
let state_helper = state.clone();
|
||||||
let available_token_condvar_helper = available_token_condvar.clone();
|
let available_token_condvar_helper = available_token_condvar.clone();
|
||||||
let helper_thread = sess
|
let helper_thread = jobserver::client()
|
||||||
.jobserver
|
|
||||||
.clone()
|
.clone()
|
||||||
.into_helper_thread(move |token| {
|
.into_helper_thread(move |token| {
|
||||||
let mut state = state_helper.lock().unwrap();
|
let mut state = state_helper.lock().unwrap();
|
||||||
|
@ -113,7 +111,7 @@ impl Drop for ConcurrencyLimiterToken {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod state {
|
mod state {
|
||||||
use jobserver::Acquired;
|
use rustc_data_structures::jobserver::Acquired;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(super) struct ConcurrencyLimiterState {
|
pub(super) struct ConcurrencyLimiterState {
|
||||||
|
|
|
@ -679,7 +679,7 @@ pub(crate) fn run_aot(
|
||||||
metadata_module: None,
|
metadata_module: None,
|
||||||
metadata,
|
metadata,
|
||||||
crate_info: CrateInfo::new(tcx, target_cpu),
|
crate_info: CrateInfo::new(tcx, target_cpu),
|
||||||
concurrency_limiter: ConcurrencyLimiter::new(tcx.sess, 0),
|
concurrency_limiter: ConcurrencyLimiter::new(0),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -711,7 +711,7 @@ pub(crate) fn run_aot(
|
||||||
CguReuse::PreLto | CguReuse::PostLto => false,
|
CguReuse::PreLto | CguReuse::PostLto => false,
|
||||||
});
|
});
|
||||||
|
|
||||||
let concurrency_limiter = IntoDynSyncSend(ConcurrencyLimiter::new(tcx.sess, todo_cgus.len()));
|
let concurrency_limiter = IntoDynSyncSend(ConcurrencyLimiter::new(todo_cgus.len()));
|
||||||
|
|
||||||
let modules = tcx.sess.time("codegen mono items", || {
|
let modules = tcx.sess.time("codegen mono items", || {
|
||||||
let mut modules: Vec<_> = par_map(todo_cgus, |(_, cgu)| {
|
let mut modules: Vec<_> = par_map(todo_cgus, |(_, cgu)| {
|
||||||
|
|
|
@ -287,12 +287,7 @@ fn dep_symbol_lookup_fn(
|
||||||
|
|
||||||
let mut dylib_paths = Vec::new();
|
let mut dylib_paths = Vec::new();
|
||||||
|
|
||||||
let data = &crate_info
|
let data = &crate_info.dependency_formats[&rustc_session::config::CrateType::Executable].1;
|
||||||
.dependency_formats
|
|
||||||
.iter()
|
|
||||||
.find(|(crate_type, _data)| *crate_type == rustc_session::config::CrateType::Executable)
|
|
||||||
.unwrap()
|
|
||||||
.1;
|
|
||||||
// `used_crates` is in reverse postorder in terms of dependencies. Reverse the order here to
|
// `used_crates` is in reverse postorder in terms of dependencies. Reverse the order here to
|
||||||
// get a postorder which ensures that all dependencies of a dylib are loaded before the dylib
|
// get a postorder which ensures that all dependencies of a dylib are loaded before the dylib
|
||||||
// itself. This helps the dynamic linker to find dylibs not in the regular dynamic library
|
// itself. This helps the dynamic linker to find dylibs not in the regular dynamic library
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#![warn(unused_lifetimes)]
|
#![warn(unused_lifetimes)]
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
|
|
||||||
extern crate jobserver;
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate rustc_middle;
|
extern crate rustc_middle;
|
||||||
extern crate rustc_abi;
|
extern crate rustc_abi;
|
||||||
|
|
|
@ -11,7 +11,6 @@ bitflags = "2.4.1"
|
||||||
cc = "1.1.23"
|
cc = "1.1.23"
|
||||||
either = "1.5.0"
|
either = "1.5.0"
|
||||||
itertools = "0.12"
|
itertools = "0.12"
|
||||||
jobserver = "0.1.28"
|
|
||||||
pathdiff = "0.2.0"
|
pathdiff = "0.2.0"
|
||||||
regex = "1.4"
|
regex = "1.4"
|
||||||
rustc_abi = { path = "../rustc_abi" }
|
rustc_abi = { path = "../rustc_abi" }
|
||||||
|
|
|
@ -236,7 +236,13 @@ pub fn each_linked_rlib(
|
||||||
) -> Result<(), errors::LinkRlibError> {
|
) -> Result<(), errors::LinkRlibError> {
|
||||||
let crates = info.used_crates.iter();
|
let crates = info.used_crates.iter();
|
||||||
|
|
||||||
let fmts = if crate_type.is_none() {
|
let fmts = if let Some(crate_type) = crate_type {
|
||||||
|
let Some(fmts) = info.dependency_formats.get(&crate_type) else {
|
||||||
|
return Err(errors::LinkRlibError::MissingFormat);
|
||||||
|
};
|
||||||
|
|
||||||
|
fmts
|
||||||
|
} else {
|
||||||
for combination in info.dependency_formats.iter().combinations(2) {
|
for combination in info.dependency_formats.iter().combinations(2) {
|
||||||
let (ty1, list1) = &combination[0];
|
let (ty1, list1) = &combination[0];
|
||||||
let (ty2, list2) = &combination[1];
|
let (ty2, list2) = &combination[1];
|
||||||
|
@ -252,18 +258,7 @@ pub fn each_linked_rlib(
|
||||||
if info.dependency_formats.is_empty() {
|
if info.dependency_formats.is_empty() {
|
||||||
return Err(errors::LinkRlibError::MissingFormat);
|
return Err(errors::LinkRlibError::MissingFormat);
|
||||||
}
|
}
|
||||||
&info.dependency_formats[0].1
|
info.dependency_formats.first().unwrap().1
|
||||||
} else {
|
|
||||||
let fmts = info
|
|
||||||
.dependency_formats
|
|
||||||
.iter()
|
|
||||||
.find_map(|&(ty, ref list)| if Some(ty) == crate_type { Some(list) } else { None });
|
|
||||||
|
|
||||||
let Some(fmts) = fmts else {
|
|
||||||
return Err(errors::LinkRlibError::MissingFormat);
|
|
||||||
};
|
|
||||||
|
|
||||||
fmts
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for &cnum in crates {
|
for &cnum in crates {
|
||||||
|
@ -624,8 +619,7 @@ fn link_staticlib(
|
||||||
let fmts = codegen_results
|
let fmts = codegen_results
|
||||||
.crate_info
|
.crate_info
|
||||||
.dependency_formats
|
.dependency_formats
|
||||||
.iter()
|
.get(&CrateType::Staticlib)
|
||||||
.find_map(|&(ty, ref list)| if ty == CrateType::Staticlib { Some(list) } else { None })
|
|
||||||
.expect("no dependency formats for staticlib");
|
.expect("no dependency formats for staticlib");
|
||||||
|
|
||||||
let mut all_rust_dylibs = vec![];
|
let mut all_rust_dylibs = vec![];
|
||||||
|
@ -2355,11 +2349,10 @@ fn linker_with_args(
|
||||||
// they are used within inlined functions or instantiated generic functions. We do this *after*
|
// they are used within inlined functions or instantiated generic functions. We do this *after*
|
||||||
// handling the raw-dylib symbols in the current crate to make sure that those are chosen first
|
// handling the raw-dylib symbols in the current crate to make sure that those are chosen first
|
||||||
// by the linker.
|
// by the linker.
|
||||||
let (_, dependency_linkage) = codegen_results
|
let dependency_linkage = codegen_results
|
||||||
.crate_info
|
.crate_info
|
||||||
.dependency_formats
|
.dependency_formats
|
||||||
.iter()
|
.get(&crate_type)
|
||||||
.find(|(ty, _)| *ty == crate_type)
|
|
||||||
.expect("failed to find crate type in dependency format list");
|
.expect("failed to find crate type in dependency format list");
|
||||||
|
|
||||||
// We sort the libraries below
|
// We sort the libraries below
|
||||||
|
@ -2738,11 +2731,10 @@ fn add_upstream_rust_crates(
|
||||||
// Linking to a rlib involves just passing it to the linker (the linker
|
// Linking to a rlib involves just passing it to the linker (the linker
|
||||||
// will slurp up the object files inside), and linking to a dynamic library
|
// will slurp up the object files inside), and linking to a dynamic library
|
||||||
// involves just passing the right -l flag.
|
// involves just passing the right -l flag.
|
||||||
let (_, data) = codegen_results
|
let data = codegen_results
|
||||||
.crate_info
|
.crate_info
|
||||||
.dependency_formats
|
.dependency_formats
|
||||||
.iter()
|
.get(&crate_type)
|
||||||
.find(|(ty, _)| *ty == crate_type)
|
|
||||||
.expect("failed to find crate type in dependency format list");
|
.expect("failed to find crate type in dependency format list");
|
||||||
|
|
||||||
if sess.target.is_like_aix {
|
if sess.target.is_like_aix {
|
||||||
|
|
|
@ -1749,7 +1749,7 @@ fn for_each_exported_symbols_include_dep<'tcx>(
|
||||||
}
|
}
|
||||||
|
|
||||||
let formats = tcx.dependency_formats(());
|
let formats = tcx.dependency_formats(());
|
||||||
let deps = formats.iter().find_map(|(t, list)| (*t == crate_type).then_some(list)).unwrap();
|
let deps = &formats[&crate_type];
|
||||||
|
|
||||||
for (index, dep_format) in deps.iter().enumerate() {
|
for (index, dep_format) in deps.iter().enumerate() {
|
||||||
let cnum = CrateNum::new(index + 1);
|
let cnum = CrateNum::new(index + 1);
|
||||||
|
|
|
@ -6,9 +6,9 @@ use std::sync::Arc;
|
||||||
use std::sync::mpsc::{Receiver, Sender, channel};
|
use std::sync::mpsc::{Receiver, Sender, channel};
|
||||||
use std::{fs, io, mem, str, thread};
|
use std::{fs, io, mem, str, thread};
|
||||||
|
|
||||||
use jobserver::{Acquired, Client};
|
|
||||||
use rustc_ast::attr;
|
use rustc_ast::attr;
|
||||||
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
|
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
|
||||||
|
use rustc_data_structures::jobserver::{self, Acquired};
|
||||||
use rustc_data_structures::memmap::Mmap;
|
use rustc_data_structures::memmap::Mmap;
|
||||||
use rustc_data_structures::profiling::{SelfProfilerRef, VerboseTimingGuard};
|
use rustc_data_structures::profiling::{SelfProfilerRef, VerboseTimingGuard};
|
||||||
use rustc_errors::emitter::Emitter;
|
use rustc_errors::emitter::Emitter;
|
||||||
|
@ -456,7 +456,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>(
|
||||||
metadata_module: Option<CompiledModule>,
|
metadata_module: Option<CompiledModule>,
|
||||||
) -> OngoingCodegen<B> {
|
) -> OngoingCodegen<B> {
|
||||||
let (coordinator_send, coordinator_receive) = channel();
|
let (coordinator_send, coordinator_receive) = channel();
|
||||||
let sess = tcx.sess;
|
|
||||||
|
|
||||||
let crate_attrs = tcx.hir().attrs(rustc_hir::CRATE_HIR_ID);
|
let crate_attrs = tcx.hir().attrs(rustc_hir::CRATE_HIR_ID);
|
||||||
let no_builtins = attr::contains_name(crate_attrs, sym::no_builtins);
|
let no_builtins = attr::contains_name(crate_attrs, sym::no_builtins);
|
||||||
|
@ -477,7 +476,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>(
|
||||||
shared_emitter,
|
shared_emitter,
|
||||||
codegen_worker_send,
|
codegen_worker_send,
|
||||||
coordinator_receive,
|
coordinator_receive,
|
||||||
sess.jobserver.clone(),
|
|
||||||
Arc::new(regular_config),
|
Arc::new(regular_config),
|
||||||
Arc::new(metadata_config),
|
Arc::new(metadata_config),
|
||||||
Arc::new(allocator_config),
|
Arc::new(allocator_config),
|
||||||
|
@ -1093,7 +1091,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
|
||||||
shared_emitter: SharedEmitter,
|
shared_emitter: SharedEmitter,
|
||||||
codegen_worker_send: Sender<CguMessage>,
|
codegen_worker_send: Sender<CguMessage>,
|
||||||
coordinator_receive: Receiver<Box<dyn Any + Send>>,
|
coordinator_receive: Receiver<Box<dyn Any + Send>>,
|
||||||
jobserver: Client,
|
|
||||||
regular_config: Arc<ModuleConfig>,
|
regular_config: Arc<ModuleConfig>,
|
||||||
metadata_config: Arc<ModuleConfig>,
|
metadata_config: Arc<ModuleConfig>,
|
||||||
allocator_config: Arc<ModuleConfig>,
|
allocator_config: Arc<ModuleConfig>,
|
||||||
|
@ -1145,7 +1142,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
|
||||||
// get tokens on `coordinator_receive` which will
|
// get tokens on `coordinator_receive` which will
|
||||||
// get managed in the main loop below.
|
// get managed in the main loop below.
|
||||||
let coordinator_send2 = coordinator_send.clone();
|
let coordinator_send2 = coordinator_send.clone();
|
||||||
let helper = jobserver
|
let helper = jobserver::client()
|
||||||
.into_helper_thread(move |token| {
|
.into_helper_thread(move |token| {
|
||||||
drop(coordinator_send2.send(Box::new(Message::Token::<B>(token))));
|
drop(coordinator_send2.send(Box::new(Message::Token::<B>(token))));
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::sync::{LazyLock, OnceLock};
|
use std::sync::{LazyLock, OnceLock};
|
||||||
|
|
||||||
pub use jobserver_crate::Client;
|
pub use jobserver_crate::{Acquired, Client, HelperThread};
|
||||||
use jobserver_crate::{FromEnv, FromEnvErrorKind};
|
use jobserver_crate::{FromEnv, FromEnvErrorKind};
|
||||||
|
|
||||||
// We can only call `from_env_ext` once per process
|
// We can only call `from_env_ext` once per process
|
||||||
|
|
|
@ -347,6 +347,8 @@ fn run_compiler(
|
||||||
|
|
||||||
callbacks.config(&mut config);
|
callbacks.config(&mut config);
|
||||||
|
|
||||||
|
let registered_lints = config.register_lints.is_some();
|
||||||
|
|
||||||
interface::run_compiler(config, |compiler| {
|
interface::run_compiler(config, |compiler| {
|
||||||
let sess = &compiler.sess;
|
let sess = &compiler.sess;
|
||||||
let codegen_backend = &*compiler.codegen_backend;
|
let codegen_backend = &*compiler.codegen_backend;
|
||||||
|
@ -362,7 +364,7 @@ fn run_compiler(
|
||||||
// `--help`/`-Zhelp`/`-Chelp`. This is the earliest it can run, because
|
// `--help`/`-Zhelp`/`-Chelp`. This is the earliest it can run, because
|
||||||
// it must happen after lints are registered, during session creation.
|
// it must happen after lints are registered, during session creation.
|
||||||
if sess.opts.describe_lints {
|
if sess.opts.describe_lints {
|
||||||
describe_lints(sess);
|
describe_lints(sess, registered_lints);
|
||||||
return early_exit();
|
return early_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -980,7 +982,7 @@ the command line flag directly.
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Write to stdout lint command options, together with a list of all available lints
|
/// Write to stdout lint command options, together with a list of all available lints
|
||||||
pub fn describe_lints(sess: &Session) {
|
pub fn describe_lints(sess: &Session, registered_lints: bool) {
|
||||||
safe_println!(
|
safe_println!(
|
||||||
"
|
"
|
||||||
Available lint options:
|
Available lint options:
|
||||||
|
@ -1084,7 +1086,7 @@ Available lint options:
|
||||||
|
|
||||||
print_lint_groups(builtin_groups, true);
|
print_lint_groups(builtin_groups, true);
|
||||||
|
|
||||||
match (sess.registered_lints, loaded.len(), loaded_groups.len()) {
|
match (registered_lints, loaded.len(), loaded_groups.len()) {
|
||||||
(false, 0, _) | (false, _, 0) => {
|
(false, 0, _) | (false, _, 0) => {
|
||||||
safe_println!("Lint tools like Clippy can load additional lints and lint groups.");
|
safe_println!("Lint tools like Clippy can load additional lints and lint groups.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3048,11 +3048,19 @@ impl FileWithAnnotatedLines {
|
||||||
// working correctly.
|
// working correctly.
|
||||||
let middle = min(ann.line_start + 4, ann.line_end);
|
let middle = min(ann.line_start + 4, ann.line_end);
|
||||||
// We'll show up to 4 lines past the beginning of the multispan start.
|
// We'll show up to 4 lines past the beginning of the multispan start.
|
||||||
// We will *not* include the tail of lines that are only whitespace.
|
// We will *not* include the tail of lines that are only whitespace, a comment or
|
||||||
|
// a bare delimiter.
|
||||||
|
let filter = |s: &str| {
|
||||||
|
let s = s.trim();
|
||||||
|
// Consider comments as empty, but don't consider docstrings to be empty.
|
||||||
|
!(s.starts_with("//") && !(s.starts_with("///") || s.starts_with("//!")))
|
||||||
|
// Consider lines with nothing but whitespace, a single delimiter as empty.
|
||||||
|
&& !["", "{", "}", "(", ")", "[", "]"].contains(&s)
|
||||||
|
};
|
||||||
let until = (ann.line_start..middle)
|
let until = (ann.line_start..middle)
|
||||||
.rev()
|
.rev()
|
||||||
.filter_map(|line| file.get_line(line - 1).map(|s| (line + 1, s)))
|
.filter_map(|line| file.get_line(line - 1).map(|s| (line + 1, s)))
|
||||||
.find(|(_, s)| !s.trim().is_empty())
|
.find(|(_, s)| filter(s))
|
||||||
.map(|(line, _)| line)
|
.map(|(line, _)| line)
|
||||||
.unwrap_or(ann.line_start);
|
.unwrap_or(ann.line_start);
|
||||||
for line in ann.line_start + 1..until {
|
for line in ann.line_start + 1..until {
|
||||||
|
@ -3060,7 +3068,8 @@ impl FileWithAnnotatedLines {
|
||||||
add_annotation_to_file(&mut output, Lrc::clone(&file), line, ann.as_line());
|
add_annotation_to_file(&mut output, Lrc::clone(&file), line, ann.as_line());
|
||||||
}
|
}
|
||||||
let line_end = ann.line_end - 1;
|
let line_end = ann.line_end - 1;
|
||||||
if middle < line_end {
|
let end_is_empty = file.get_line(line_end - 1).map_or(false, |s| !filter(&s));
|
||||||
|
if middle < line_end && !end_is_empty {
|
||||||
add_annotation_to_file(&mut output, Lrc::clone(&file), line_end, ann.as_line());
|
add_annotation_to_file(&mut output, Lrc::clone(&file), line_end, ann.as_line());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -201,12 +201,13 @@ pub(crate) fn placeholder_type_error_diag<'cx, 'tcx>(
|
||||||
placeholder_types.iter().map(|sp| (*sp, (*type_name).to_string())).collect();
|
placeholder_types.iter().map(|sp| (*sp, (*type_name).to_string())).collect();
|
||||||
|
|
||||||
if let Some(generics) = generics {
|
if let Some(generics) = generics {
|
||||||
if let Some(arg) = params.iter().find(|arg| {
|
if let Some(span) = params.iter().find_map(|arg| match arg.name {
|
||||||
matches!(arg.name, hir::ParamName::Plain(Ident { name: kw::Underscore, .. }))
|
hir::ParamName::Plain(Ident { name: kw::Underscore, span }) => Some(span),
|
||||||
|
_ => None,
|
||||||
}) {
|
}) {
|
||||||
// Account for `_` already present in cases like `struct S<_>(_);` and suggest
|
// Account for `_` already present in cases like `struct S<_>(_);` and suggest
|
||||||
// `struct S<T>(T);` instead of `struct S<_, T>(T);`.
|
// `struct S<T>(T);` instead of `struct S<_, T>(T);`.
|
||||||
sugg.push((arg.span, (*type_name).to_string()));
|
sugg.push((span, (*type_name).to_string()));
|
||||||
} else if let Some(span) = generics.span_for_param_suggestion() {
|
} else if let Some(span) = generics.span_for_param_suggestion() {
|
||||||
// Account for bounds, we want `fn foo<T: E, K>(_: K)` not `fn foo<T, K: E>(_: K)`.
|
// Account for bounds, we want `fn foo<T: E, K>(_: K)` not `fn foo<T, K: E>(_: K)`.
|
||||||
sugg.push((span, format!(", {type_name}")));
|
sugg.push((span, format!(", {type_name}")));
|
||||||
|
|
|
@ -371,7 +371,6 @@ pub(crate) fn initialize_checked_jobserver(early_dcx: &EarlyDiagCtxt) {
|
||||||
|
|
||||||
// JUSTIFICATION: before session exists, only config
|
// JUSTIFICATION: before session exists, only config
|
||||||
#[allow(rustc::bad_opt_access)]
|
#[allow(rustc::bad_opt_access)]
|
||||||
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
|
|
||||||
pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R {
|
pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R {
|
||||||
trace!("run_compiler");
|
trace!("run_compiler");
|
||||||
|
|
||||||
|
@ -425,7 +424,11 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
|
||||||
config.opts.unstable_opts.translate_directionality_markers,
|
config.opts.unstable_opts.translate_directionality_markers,
|
||||||
) {
|
) {
|
||||||
Ok(bundle) => bundle,
|
Ok(bundle) => bundle,
|
||||||
Err(e) => early_dcx.early_fatal(format!("failed to load fluent bundle: {e}")),
|
Err(e) => {
|
||||||
|
// We can't translate anything if we failed to load translations
|
||||||
|
#[allow(rustc::untranslatable_diagnostic)]
|
||||||
|
early_dcx.early_fatal(format!("failed to load fluent bundle: {e}"))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut locale_resources = config.locale_resources;
|
let mut locale_resources = config.locale_resources;
|
||||||
|
@ -479,7 +482,6 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
|
||||||
let mut lint_store = rustc_lint::new_lint_store(sess.enable_internal_lints());
|
let mut lint_store = rustc_lint::new_lint_store(sess.enable_internal_lints());
|
||||||
if let Some(register_lints) = config.register_lints.as_deref() {
|
if let Some(register_lints) = config.register_lints.as_deref() {
|
||||||
register_lints(&sess, &mut lint_store);
|
register_lints(&sess, &mut lint_store);
|
||||||
sess.registered_lints = true;
|
|
||||||
}
|
}
|
||||||
sess.lint_store = Some(Lrc::new(lint_store));
|
sess.lint_store = Some(Lrc::new(lint_store));
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ pub(crate) fn calculate(tcx: TyCtxt<'_>) -> Dependencies {
|
||||||
verify_ok(tcx, &linkage);
|
verify_ok(tcx, &linkage);
|
||||||
(ty, linkage)
|
(ty, linkage)
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
|
fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
|
||||||
|
|
|
@ -2161,10 +2161,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
||||||
fn encode_dylib_dependency_formats(&mut self) -> LazyArray<Option<LinkagePreference>> {
|
fn encode_dylib_dependency_formats(&mut self) -> LazyArray<Option<LinkagePreference>> {
|
||||||
empty_proc_macro!(self);
|
empty_proc_macro!(self);
|
||||||
let formats = self.tcx.dependency_formats(());
|
let formats = self.tcx.dependency_formats(());
|
||||||
for (ty, arr) in formats.iter() {
|
if let Some(arr) = formats.get(&CrateType::Dylib) {
|
||||||
if *ty != CrateType::Dylib {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return self.lazy_array(arr.iter().map(|slot| match *slot {
|
return self.lazy_array(arr.iter().map(|slot| match *slot {
|
||||||
Linkage::NotLinked | Linkage::IncludedFromDylib => None,
|
Linkage::NotLinked | Linkage::IncludedFromDylib => None,
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
// FIXME: move this file to rustc_metadata::dependency_format, but
|
// FIXME: move this file to rustc_metadata::dependency_format, but
|
||||||
// this will introduce circular dependency between rustc_metadata and rustc_middle
|
// this will introduce circular dependency between rustc_metadata and rustc_middle
|
||||||
|
|
||||||
|
use rustc_data_structures::fx::FxIndexMap;
|
||||||
use rustc_macros::{Decodable, Encodable, HashStable};
|
use rustc_macros::{Decodable, Encodable, HashStable};
|
||||||
use rustc_session::config::CrateType;
|
use rustc_session::config::CrateType;
|
||||||
|
|
||||||
|
@ -18,7 +19,7 @@ pub type DependencyList = Vec<Linkage>;
|
||||||
/// A mapping of all required dependencies for a particular flavor of output.
|
/// A mapping of all required dependencies for a particular flavor of output.
|
||||||
///
|
///
|
||||||
/// This is local to the tcx, and is generally relevant to one session.
|
/// This is local to the tcx, and is generally relevant to one session.
|
||||||
pub type Dependencies = Vec<(CrateType, DependencyList)>;
|
pub type Dependencies = FxIndexMap<CrateType, DependencyList>;
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Debug, HashStable, Encodable, Decodable)]
|
#[derive(Copy, Clone, PartialEq, Debug, HashStable, Encodable, Decodable)]
|
||||||
pub enum Linkage {
|
pub enum Linkage {
|
||||||
|
|
|
@ -8,7 +8,6 @@ use std::{env, fmt, io};
|
||||||
|
|
||||||
use rustc_data_structures::flock;
|
use rustc_data_structures::flock;
|
||||||
use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
|
use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
|
||||||
use rustc_data_structures::jobserver::{self, Client};
|
|
||||||
use rustc_data_structures::profiling::{SelfProfiler, SelfProfilerRef};
|
use rustc_data_structures::profiling::{SelfProfiler, SelfProfilerRef};
|
||||||
use rustc_data_structures::sync::{
|
use rustc_data_structures::sync::{
|
||||||
DynSend, DynSync, Lock, Lrc, MappedReadGuard, ReadGuard, RwLock,
|
DynSend, DynSync, Lock, Lrc, MappedReadGuard, ReadGuard, RwLock,
|
||||||
|
@ -154,16 +153,9 @@ pub struct Session {
|
||||||
/// Data about code being compiled, gathered during compilation.
|
/// Data about code being compiled, gathered during compilation.
|
||||||
pub code_stats: CodeStats,
|
pub code_stats: CodeStats,
|
||||||
|
|
||||||
/// Loaded up early on in the initialization of this `Session` to avoid
|
|
||||||
/// false positives about a job server in our environment.
|
|
||||||
pub jobserver: Client,
|
|
||||||
|
|
||||||
/// This only ever stores a `LintStore` but we don't want a dependency on that type here.
|
/// This only ever stores a `LintStore` but we don't want a dependency on that type here.
|
||||||
pub lint_store: Option<Lrc<dyn LintStoreMarker>>,
|
pub lint_store: Option<Lrc<dyn LintStoreMarker>>,
|
||||||
|
|
||||||
/// Should be set if any lints are registered in `lint_store`.
|
|
||||||
pub registered_lints: bool,
|
|
||||||
|
|
||||||
/// Cap lint level specified by a driver specifically.
|
/// Cap lint level specified by a driver specifically.
|
||||||
pub driver_lint_caps: FxHashMap<lint::LintId, lint::Level>,
|
pub driver_lint_caps: FxHashMap<lint::LintId, lint::Level>,
|
||||||
|
|
||||||
|
@ -1072,9 +1064,7 @@ pub fn build_session(
|
||||||
incr_comp_session: RwLock::new(IncrCompSession::NotInitialized),
|
incr_comp_session: RwLock::new(IncrCompSession::NotInitialized),
|
||||||
prof,
|
prof,
|
||||||
code_stats: Default::default(),
|
code_stats: Default::default(),
|
||||||
jobserver: jobserver::client(),
|
|
||||||
lint_store: None,
|
lint_store: None,
|
||||||
registered_lints: false,
|
|
||||||
driver_lint_caps,
|
driver_lint_caps,
|
||||||
ctfe_backtrace,
|
ctfe_backtrace,
|
||||||
miri_unleashed_features: Lock::new(Default::default()),
|
miri_unleashed_features: Lock::new(Default::default()),
|
||||||
|
|
|
@ -471,7 +471,7 @@ impl Step for Rustc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if builder.config.llvm_enabled(compiler.host) && builder.config.llvm_tools_enabled {
|
||||||
let src_dir = builder.sysroot_target_bindir(compiler, host);
|
let src_dir = builder.sysroot_target_bindir(compiler, host);
|
||||||
let llvm_objcopy = exe("llvm-objcopy", compiler.host);
|
let llvm_objcopy = exe("llvm-objcopy", compiler.host);
|
||||||
let rust_objcopy = exe("rust-objcopy", compiler.host);
|
let rust_objcopy = exe("rust-objcopy", compiler.host);
|
||||||
|
|
|
@ -1320,7 +1320,31 @@ impl Config {
|
||||||
|
|
||||||
// Set flags.
|
// Set flags.
|
||||||
config.paths = std::mem::take(&mut flags.paths);
|
config.paths = std::mem::take(&mut flags.paths);
|
||||||
config.skip = flags.skip.into_iter().chain(flags.exclude).collect();
|
config.skip = flags
|
||||||
|
.skip
|
||||||
|
.into_iter()
|
||||||
|
.chain(flags.exclude)
|
||||||
|
.map(|p| {
|
||||||
|
let p = if cfg!(windows) {
|
||||||
|
PathBuf::from(p.to_str().unwrap().replace('/', "\\"))
|
||||||
|
} else {
|
||||||
|
p
|
||||||
|
};
|
||||||
|
|
||||||
|
// Jump to top-level project path to support passing paths
|
||||||
|
// from sub directories.
|
||||||
|
let top_level_path = config.src.join(&p);
|
||||||
|
if !config.src.join(&top_level_path).exists() {
|
||||||
|
eprintln!("WARNING: '{}' does not exist.", top_level_path.display());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Never return top-level path here as it would break `--skip`
|
||||||
|
// logic on rustc's internal test framework which is utilized
|
||||||
|
// by compiletest.
|
||||||
|
p
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
config.include_default_paths = flags.include_default_paths;
|
config.include_default_paths = flags.include_default_paths;
|
||||||
config.rustc_error_format = flags.rustc_error_format;
|
config.rustc_error_format = flags.rustc_error_format;
|
||||||
config.json_output = flags.json_output;
|
config.json_output = flags.json_output;
|
||||||
|
|
|
@ -423,6 +423,14 @@ pub(crate) fn build_index(
|
||||||
}
|
}
|
||||||
Some(path)
|
Some(path)
|
||||||
});
|
});
|
||||||
|
} else if let Some(parent_idx) = item.parent_idx {
|
||||||
|
let i = <isize as TryInto<usize>>::try_into(parent_idx).unwrap();
|
||||||
|
item.path = {
|
||||||
|
let p = &crate_paths[i].1;
|
||||||
|
join_with_double_colon(&p[..p.len() - 1])
|
||||||
|
};
|
||||||
|
item.exact_path =
|
||||||
|
crate_paths[i].2.as_ref().map(|xp| join_with_double_colon(&xp[..xp.len() - 1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Omit the parent path if it is same to that of the prior item.
|
// Omit the parent path if it is same to that of the prior item.
|
||||||
|
|
|
@ -846,11 +846,13 @@ fn main_args(
|
||||||
|
|
||||||
let config = core::create_config(input, options, &render_options, using_internal_features);
|
let config = core::create_config(input, options, &render_options, using_internal_features);
|
||||||
|
|
||||||
|
let registered_lints = config.register_lints.is_some();
|
||||||
|
|
||||||
interface::run_compiler(config, |compiler| {
|
interface::run_compiler(config, |compiler| {
|
||||||
let sess = &compiler.sess;
|
let sess = &compiler.sess;
|
||||||
|
|
||||||
if sess.opts.describe_lints {
|
if sess.opts.describe_lints {
|
||||||
rustc_driver::describe_lints(sess);
|
rustc_driver::describe_lints(sess, registered_lints);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ LL | | fn clone_self(&self) -> Self {
|
||||||
LL | | Self {
|
LL | | Self {
|
||||||
LL | | a: true,
|
LL | | a: true,
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -32,7 +31,6 @@ LL | | fn default() -> Self {
|
||||||
LL | | Self {
|
LL | | Self {
|
||||||
LL | | a: true,
|
LL | | a: true,
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,7 @@ error: this block is too nested
|
||||||
LL | if true {
|
LL | if true {
|
||||||
| _________________________^
|
| _________________________^
|
||||||
LL | | if true {
|
LL | | if true {
|
||||||
LL | |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_________________^
|
| |_________________^
|
||||||
|
|
|
|
||||||
|
|
|
@ -286,7 +286,6 @@ LL | | if unsafe { true } {
|
||||||
LL | | todo!();
|
LL | | todo!();
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |______^
|
| |______^
|
||||||
|
|
|
|
||||||
|
|
|
@ -294,7 +294,6 @@ LL | | if unsafe { true } {
|
||||||
LL | | todo!();
|
LL | | todo!();
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |______^
|
| |______^
|
||||||
|
|
|
|
||||||
|
|
|
@ -80,7 +80,6 @@ error: an async construct yields a type which is itself awaitable
|
||||||
LL | let _m = async || {
|
LL | let _m = async || {
|
||||||
| _______________________-
|
| _______________________-
|
||||||
LL | | println!("I'm bored");
|
LL | | println!("I'm bored");
|
||||||
LL | | // Some more stuff
|
|
||||||
... |
|
... |
|
||||||
LL | | CustomFutureType
|
LL | | CustomFutureType
|
||||||
| | ^^^^^^^^^^^^^^^^
|
| | ^^^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -44,7 +44,6 @@ LL | | if {
|
||||||
LL | | if s == "43" {
|
LL | | if s == "43" {
|
||||||
LL | | return Some(43);
|
LL | | return Some(43);
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | });
|
LL | | });
|
||||||
| |______^
|
| |______^
|
||||||
|
|
|
|
||||||
|
|
|
@ -115,8 +115,7 @@ error: all if blocks contain the same code at the end
|
||||||
--> tests/ui/branches_sharing_code/shared_at_bottom.rs:183:5
|
--> tests/ui/branches_sharing_code/shared_at_bottom.rs:183:5
|
||||||
|
|
|
|
||||||
LL | / x << 2
|
LL | / x << 2
|
||||||
LL | |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -131,8 +130,7 @@ error: all if blocks contain the same code at the end
|
||||||
--> tests/ui/branches_sharing_code/shared_at_bottom.rs:192:5
|
--> tests/ui/branches_sharing_code/shared_at_bottom.rs:192:5
|
||||||
|
|
|
|
||||||
LL | / x * 4
|
LL | / x * 4
|
||||||
LL | |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
|
|
@ -43,9 +43,7 @@ LL | } else {
|
||||||
| ____________^
|
| ____________^
|
||||||
LL | | if y == "world" {
|
LL | | if y == "world" {
|
||||||
LL | | println!("world")
|
LL | | println!("world")
|
||||||
LL | | }
|
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -66,9 +64,7 @@ LL | } else {
|
||||||
| ____________^
|
| ____________^
|
||||||
LL | | if let Some(42) = Some(42) {
|
LL | | if let Some(42) = Some(42) {
|
||||||
LL | | println!("world")
|
LL | | println!("world")
|
||||||
LL | | }
|
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -89,9 +85,7 @@ LL | } else {
|
||||||
| ____________^
|
| ____________^
|
||||||
LL | | if let Some(42) = Some(42) {
|
LL | | if let Some(42) = Some(42) {
|
||||||
LL | | println!("world")
|
LL | | println!("world")
|
||||||
LL | | }
|
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -112,9 +106,7 @@ LL | } else {
|
||||||
| ____________^
|
| ____________^
|
||||||
LL | | if x == "hello" {
|
LL | | if x == "hello" {
|
||||||
LL | | println!("world")
|
LL | | println!("world")
|
||||||
LL | | }
|
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -135,9 +127,7 @@ LL | } else {
|
||||||
| ____________^
|
| ____________^
|
||||||
LL | | if let Some(42) = Some(42) {
|
LL | | if let Some(42) = Some(42) {
|
||||||
LL | | println!("world")
|
LL | | println!("world")
|
||||||
LL | | }
|
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | |
|
||||||
LL | |
|
LL | |
|
||||||
LL | | type Item = u8;
|
LL | | type Item = u8;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
|
|
@ -2,11 +2,7 @@ error: this loop never actually loops
|
||||||
--> tests/ui/crashes/ice-360.rs:5:5
|
--> tests/ui/crashes/ice-360.rs:5:5
|
||||||
|
|
|
|
||||||
LL | / loop {
|
LL | / loop {
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -16,11 +12,7 @@ error: this loop could be written as a `while let` loop
|
||||||
--> tests/ui/crashes/ice-360.rs:5:5
|
--> tests/ui/crashes/ice-360.rs:5:5
|
||||||
|
|
|
|
||||||
LL | / loop {
|
LL | / loop {
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^ help: try: `while let Some(ele) = iter.next() { .. }`
|
| |_____^ help: try: `while let Some(ele) = iter.next() { .. }`
|
||||||
|
|
|
|
||||||
|
|
|
@ -2,8 +2,7 @@ error: this looks like you are trying to swap `a` and `b`
|
||||||
--> tests/ui/crate_level_checks/no_std_swap.rs:12:5
|
--> tests/ui/crate_level_checks/no_std_swap.rs:12:5
|
||||||
|
|
|
|
||||||
LL | / a = b;
|
LL | / a = b;
|
||||||
LL | |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | b = a;
|
LL | | b = a;
|
||||||
| |_________^ help: try: `core::mem::swap(&mut a, &mut b)`
|
| |_________^ help: try: `core::mem::swap(&mut a, &mut b)`
|
||||||
|
|
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | | fn default() -> Self {
|
||||||
LL | | Self {
|
LL | | Self {
|
||||||
LL | | a: false,
|
LL | | a: false,
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
|
|
@ -99,8 +99,7 @@ LL | / /// for OldA
|
||||||
LL | | // struct OldA;
|
LL | | // struct OldA;
|
||||||
LL | |
|
LL | |
|
||||||
LL | | /// Docs
|
LL | | /// Docs
|
||||||
LL | | /// for OldB
|
... |
|
||||||
LL | | // struct OldB;
|
|
||||||
LL | |
|
LL | |
|
||||||
| |_^
|
| |_^
|
||||||
...
|
...
|
||||||
|
|
|
@ -103,8 +103,7 @@ error: empty lines after outer attribute
|
||||||
--> tests/ui/empty_line_after/outer_attribute.rs:64:1
|
--> tests/ui/empty_line_after/outer_attribute.rs:64:1
|
||||||
|
|
|
|
||||||
LL | / #[allow(unused)]
|
LL | / #[allow(unused)]
|
||||||
LL | |
|
... |
|
||||||
LL | | // This comment is isolated
|
|
||||||
LL | |
|
LL | |
|
||||||
| |_^
|
| |_^
|
||||||
LL | pub fn isolated_comment() {}
|
LL | pub fn isolated_comment() {}
|
||||||
|
|
|
@ -16,8 +16,7 @@ LL | / if !m.contains_key(&k) {
|
||||||
LL | | if true {
|
LL | | if true {
|
||||||
LL | | m.insert(k, v);
|
LL | | m.insert(k, v);
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
LL | | m.insert(k, v2);
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -63,7 +62,6 @@ LL | | if true {
|
||||||
LL | | m.insert(k, v);
|
LL | | m.insert(k, v);
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -154,7 +152,6 @@ LL | | foo();
|
||||||
LL | | match 0 {
|
LL | | match 0 {
|
||||||
LL | | 0 if false => {
|
LL | | 0 if false => {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ error: all variants have the same prefix: `c`
|
||||||
LL | / enum Foo {
|
LL | / enum Foo {
|
||||||
LL | |
|
LL | |
|
||||||
LL | | cFoo,
|
LL | | cFoo,
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | cBaz,
|
LL | | cBaz,
|
||||||
LL | | }
|
LL | | }
|
||||||
|
@ -45,9 +44,7 @@ error: all variants have the same prefix: `Food`
|
||||||
LL | / enum Food {
|
LL | / enum Food {
|
||||||
LL | |
|
LL | |
|
||||||
LL | | FoodGood,
|
LL | | FoodGood,
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
|
|
@ -29,7 +29,6 @@ LL | |
|
||||||
LL | | fn from(i: usize) -> Invalid {
|
LL | | fn from(i: usize) -> Invalid {
|
||||||
LL | | if i != 42 {
|
LL | | if i != 42 {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -49,7 +48,6 @@ LL | |
|
||||||
LL | | fn from(s: Option<String>) -> Invalid {
|
LL | | fn from(s: Option<String>) -> Invalid {
|
||||||
LL | | let s = s.unwrap();
|
LL | | let s = s.unwrap();
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -76,7 +74,6 @@ LL | |
|
||||||
LL | | fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
|
LL | | fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
|
||||||
LL | | if s.parse::<u32>().ok().unwrap() != 42 {
|
LL | | if s.parse::<u32>().ok().unwrap() != 42 {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ LL | | for _ in &[42] {
|
||||||
LL | | let foo: &Option<_> = &Some::<u8>(42);
|
LL | | let foo: &Option<_> = &Some::<u8>(42);
|
||||||
LL | | if foo.is_some() {
|
LL | | if foo.is_some() {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -20,7 +19,6 @@ LL | | for _ in &[42] {
|
||||||
LL | | let bar: &Option<_> = &Some::<u8>(42);
|
LL | | let bar: &Option<_> = &Some::<u8>(42);
|
||||||
LL | | if bar.is_some() {
|
LL | | if bar.is_some() {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
||||||
|
|
|
@ -20,7 +20,6 @@ error: infinite loop detected
|
||||||
LL | / loop {
|
LL | / loop {
|
||||||
LL | |
|
LL | |
|
||||||
LL | | loop {
|
LL | | loop {
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | do_something();
|
LL | | do_something();
|
||||||
LL | | }
|
LL | | }
|
||||||
|
@ -37,9 +36,7 @@ error: infinite loop detected
|
||||||
LL | / loop {
|
LL | / loop {
|
||||||
LL | |
|
LL | |
|
||||||
LL | | loop {
|
LL | | loop {
|
||||||
LL | |
|
... |
|
||||||
LL | | do_something();
|
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_________^
|
| |_________^
|
||||||
|
|
|
|
||||||
|
@ -79,8 +76,7 @@ error: infinite loop detected
|
||||||
LL | / loop {
|
LL | / loop {
|
||||||
LL | | fn inner_fn() -> ! {
|
LL | | fn inner_fn() -> ! {
|
||||||
LL | | std::process::exit(0);
|
LL | | std::process::exit(0);
|
||||||
LL | | }
|
... |
|
||||||
LL | | do_something();
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -97,7 +93,6 @@ LL | |
|
||||||
LL | | loop {
|
LL | | loop {
|
||||||
LL | | if cond {
|
LL | | if cond {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -114,7 +109,6 @@ LL | |
|
||||||
LL | | 'inner: loop {
|
LL | | 'inner: loop {
|
||||||
LL | | loop {
|
LL | | loop {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -145,7 +139,6 @@ LL | |
|
||||||
LL | | 'inner: loop {
|
LL | | 'inner: loop {
|
||||||
LL | | loop {
|
LL | | loop {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_________^
|
| |_________^
|
||||||
|
|
|
|
||||||
|
@ -162,7 +155,6 @@ LL | |
|
||||||
LL | | match opt {
|
LL | | match opt {
|
||||||
LL | | Some(v) => {
|
LL | | Some(v) => {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -279,7 +271,6 @@ LL | |
|
||||||
LL | | 'inner: loop {
|
LL | | 'inner: loop {
|
||||||
LL | | loop {
|
LL | | loop {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | |
|
||||||
LL | | type IntoIter = std::slice::Iter<'a, u8>;
|
LL | | type IntoIter = std::slice::Iter<'a, u8>;
|
||||||
LL | | type Item = &'a u8;
|
LL | | type Item = &'a u8;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -30,7 +29,6 @@ LL | |
|
||||||
LL | | type IntoIter = std::slice::IterMut<'a, u8>;
|
LL | | type IntoIter = std::slice::IterMut<'a, u8>;
|
||||||
LL | | type Item = &'a mut u8;
|
LL | | type Item = &'a mut u8;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -52,7 +50,6 @@ LL | |
|
||||||
LL | | type IntoIter = std::slice::Iter<'a, T>;
|
LL | | type IntoIter = std::slice::Iter<'a, T>;
|
||||||
LL | | type Item = &'a T;
|
LL | | type Item = &'a T;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -74,7 +71,6 @@ LL | |
|
||||||
LL | | type IntoIter = std::slice::IterMut<'a, T>;
|
LL | | type IntoIter = std::slice::IterMut<'a, T>;
|
||||||
LL | | type Item = &'a mut T;
|
LL | | type Item = &'a mut T;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -96,7 +92,6 @@ LL | |
|
||||||
LL | | type IntoIter = std::slice::IterMut<'a, T>;
|
LL | | type IntoIter = std::slice::IterMut<'a, T>;
|
||||||
LL | | type Item = &'a mut T;
|
LL | | type Item = &'a mut T;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -117,8 +112,7 @@ LL | / impl<'a> IntoIterator for &'a Issue12037 {
|
||||||
LL | | type IntoIter = std::slice::Iter<'a, u8>;
|
LL | | type IntoIter = std::slice::Iter<'a, u8>;
|
||||||
LL | | type Item = &'a u8;
|
LL | | type Item = &'a u8;
|
||||||
LL | | fn into_iter(self) -> Self::IntoIter {
|
LL | | fn into_iter(self) -> Self::IntoIter {
|
||||||
LL | | todo!()
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_________^
|
| |_________^
|
||||||
...
|
...
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | |
|
||||||
LL | |
|
LL | |
|
||||||
LL | | if s == String::new() {
|
LL | | if s == String::new() {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `strings.into_iter().find(|s| s == String::new())`
|
| |________^ help: replace with an iterator: `strings.into_iter().find(|s| s == String::new())`
|
||||||
|
|
|
|
||||||
|
@ -22,7 +21,6 @@ LL | |
|
||||||
LL | |
|
LL | |
|
||||||
LL | | if s == String::new() {
|
LL | | if s == String::new() {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `arr.into_iter().map(|(s, _)| s).find(|s| s == String::new())`
|
| |________^ help: replace with an iterator: `arr.into_iter().map(|(s, _)| s).find(|s| s == String::new())`
|
||||||
|
|
|
|
||||||
|
|
|
@ -4,8 +4,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for &v in ARRAY {
|
LL | / for &v in ARRAY {
|
||||||
LL | | if v == n {
|
LL | | if v == n {
|
||||||
LL | | return Some(v);
|
LL | | return Some(v);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `ARRAY.iter().find(|&&v| v == n).copied()`
|
| |________^ help: replace with an iterator: `ARRAY.iter().find(|&&v| v == n).copied()`
|
||||||
|
|
|
|
||||||
|
@ -18,8 +17,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for (a, _) in arr {
|
LL | / for (a, _) in arr {
|
||||||
LL | | if a % 2 == 0 {
|
LL | | if a % 2 == 0 {
|
||||||
LL | | return Some(a);
|
LL | | return Some(a);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `arr.into_iter().map(|(a, _)| a).find(|&a| a % 2 == 0)`
|
| |________^ help: replace with an iterator: `arr.into_iter().map(|(a, _)| a).find(|&a| a % 2 == 0)`
|
||||||
|
|
||||||
|
@ -29,8 +27,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for el in arr {
|
LL | / for el in arr {
|
||||||
LL | | if el.name.len() == 10 {
|
LL | | if el.name.len() == 10 {
|
||||||
LL | | return Some(el);
|
LL | | return Some(el);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `arr.into_iter().find(|el| el.name.len() == 10)`
|
| |________^ help: replace with an iterator: `arr.into_iter().find(|el| el.name.len() == 10)`
|
||||||
|
|
|
|
||||||
|
@ -42,8 +39,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for Tuple(a, _) in arr {
|
LL | / for Tuple(a, _) in arr {
|
||||||
LL | | if a >= 3 {
|
LL | | if a >= 3 {
|
||||||
LL | | return Some(a);
|
LL | | return Some(a);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `arr.into_iter().map(|Tuple(a, _)| a).find(|&a| a >= 3)`
|
| |________^ help: replace with an iterator: `arr.into_iter().map(|Tuple(a, _)| a).find(|&a| a >= 3)`
|
||||||
|
|
||||||
|
@ -53,8 +49,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for el in arr {
|
LL | / for el in arr {
|
||||||
LL | | if el.should_keep() {
|
LL | | if el.should_keep() {
|
||||||
LL | | return Some(el);
|
LL | | return Some(el);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `arr.into_iter().find(|el| el.should_keep())`
|
| |________^ help: replace with an iterator: `arr.into_iter().find(|el| el.should_keep())`
|
||||||
|
|
|
|
||||||
|
@ -66,8 +61,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for el in arr {
|
LL | / for el in arr {
|
||||||
LL | | if f(el) == 20 {
|
LL | | if f(el) == 20 {
|
||||||
LL | | return Some(el);
|
LL | | return Some(el);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `arr.into_iter().find(|&el| f(el) == 20)`
|
| |________^ help: replace with an iterator: `arr.into_iter().find(|&el| f(el) == 20)`
|
||||||
|
|
||||||
|
@ -77,8 +71,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for &el in arr.values() {
|
LL | / for &el in arr.values() {
|
||||||
LL | | if f(el) {
|
LL | | if f(el) {
|
||||||
LL | | return Some(el);
|
LL | | return Some(el);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `arr.values().find(|&&el| f(el)).copied()`
|
| |________^ help: replace with an iterator: `arr.values().find(|&&el| f(el)).copied()`
|
||||||
|
|
||||||
|
@ -88,8 +81,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for el in arr {
|
LL | / for el in arr {
|
||||||
LL | | if el.is_true {
|
LL | | if el.is_true {
|
||||||
LL | | return Some(el);
|
LL | | return Some(el);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `arr.into_iter().find(|el| el.is_true)`
|
| |________^ help: replace with an iterator: `arr.into_iter().find(|el| el.is_true)`
|
||||||
|
|
|
|
||||||
|
@ -101,8 +93,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for (_, &x) in v {
|
LL | / for (_, &x) in v {
|
||||||
LL | | if x > 10 {
|
LL | | if x > 10 {
|
||||||
LL | | return Some(x);
|
LL | | return Some(x);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `v.into_iter().map(|(_, &x)| x).find(|&x| x > 10)`
|
| |________^ help: replace with an iterator: `v.into_iter().map(|(_, &x)| x).find(|&x| x > 10)`
|
||||||
|
|
||||||
|
@ -112,8 +103,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for &(_, &x) in v {
|
LL | / for &(_, &x) in v {
|
||||||
LL | | if x > 10 {
|
LL | | if x > 10 {
|
||||||
LL | | return Some(x);
|
LL | | return Some(x);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |________^ help: replace with an iterator: `v.iter().map(|&(_, &x)| x).find(|&x| x > 10)`
|
| |________^ help: replace with an iterator: `v.iter().map(|&(_, &x)| x).find(|&x| x > 10)`
|
||||||
|
|
||||||
|
@ -123,8 +113,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for x in arr {
|
LL | / for x in arr {
|
||||||
LL | | if x >= 5 {
|
LL | | if x >= 5 {
|
||||||
LL | | return Some(x);
|
LL | | return Some(x);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | return None;
|
LL | | return None;
|
||||||
| |________________^ help: replace with an iterator: `arr.into_iter().find(|&x| x >= 5)`
|
| |________________^ help: replace with an iterator: `arr.into_iter().find(|&x| x >= 5)`
|
||||||
|
|
||||||
|
@ -134,8 +123,7 @@ error: manual implementation of `Iterator::find`
|
||||||
LL | / for x in arr {
|
LL | / for x in arr {
|
||||||
LL | | if x < 1 {
|
LL | | if x < 1 {
|
||||||
LL | | return Some(x);
|
LL | | return Some(x);
|
||||||
LL | | }
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | None
|
LL | | None
|
||||||
| |____________^ help: replace with an iterator: `arr.into_iter().find(|&x| x < 1)`
|
| |____________^ help: replace with an iterator: `arr.into_iter().find(|&x| x < 1)`
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,6 @@ LL | |
|
||||||
LL | | Some(1),
|
LL | | Some(1),
|
||||||
LL | | Some(2),
|
LL | | Some(2),
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
|
|
@ -148,7 +148,6 @@ LL | |
|
||||||
LL | | v_some
|
LL | | v_some
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |______^
|
| |______^
|
||||||
|
|
|
|
||||||
|
@ -175,7 +174,6 @@ LL | |
|
||||||
LL | | v_some
|
LL | | v_some
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |______^
|
| |______^
|
||||||
|
|
|
|
||||||
|
@ -197,7 +195,6 @@ LL | |
|
||||||
LL | | v_some
|
LL | | v_some
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |______^
|
| |______^
|
||||||
|
|
|
|
||||||
|
@ -306,7 +303,6 @@ LL | |
|
||||||
LL | | v_some
|
LL | | v_some
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |______^
|
| |______^
|
||||||
|
|
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ LL | | Some(i) => i,
|
||||||
LL | | None => {
|
LL | | None => {
|
||||||
LL | | 42 + 42
|
LL | | 42 + 42
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -130,7 +129,6 @@ LL | | Ok(i) => i,
|
||||||
LL | | Err(_) => {
|
LL | | Err(_) => {
|
||||||
LL | | 42 + 42
|
LL | | 42 + 42
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
|
|
@ -77,9 +77,6 @@ error: called `map(..).flatten()` on `Option`
|
||||||
|
|
|
|
||||||
LL | .map(|_| {
|
LL | .map(|_| {
|
||||||
| __________^
|
| __________^
|
||||||
LL | | // we need some newlines
|
|
||||||
LL | | // so that the span is big enough
|
|
||||||
LL | | // for a split output of the diagnostic
|
|
||||||
... |
|
... |
|
||||||
LL | | })
|
LL | | })
|
||||||
LL | | .flatten();
|
LL | | .flatten();
|
||||||
|
|
|
@ -75,9 +75,6 @@ error: you seem to be trying to match on a boolean expression
|
||||||
--> tests/ui/match_bool.rs:36:5
|
--> tests/ui/match_bool.rs:36:5
|
||||||
|
|
|
|
||||||
LL | / match test && test {
|
LL | / match test && test {
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | _ => (),
|
LL | | _ => (),
|
||||||
LL | | };
|
LL | | };
|
||||||
|
|
|
@ -68,8 +68,7 @@ LL | let _ans = match x {
|
||||||
| ____________________^
|
| ____________________^
|
||||||
LL | | E::A(_) => {
|
LL | | E::A(_) => {
|
||||||
LL | | true
|
LL | | true
|
||||||
LL | | }
|
... |
|
||||||
LL | | E::B(_) => true,
|
|
||||||
LL | | _ => false,
|
LL | | _ => false,
|
||||||
LL | | };
|
LL | | };
|
||||||
| |_________^ help: try: `matches!(x, E::A(_) | E::B(_))`
|
| |_________^ help: try: `matches!(x, E::A(_) | E::B(_))`
|
||||||
|
|
|
@ -72,7 +72,6 @@ LL | | /// dox
|
||||||
LL | | pub fn documented() {}
|
LL | | pub fn documented() {}
|
||||||
LL | | pub fn undocumented1() {}
|
LL | | pub fn undocumented1() {}
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@ error: missing documentation for the crate
|
||||||
--> tests/ui/missing_doc_crate_missing.rs:1:1
|
--> tests/ui/missing_doc_crate_missing.rs:1:1
|
||||||
|
|
|
|
||||||
LL | / #![warn(clippy::missing_docs_in_private_items)]
|
LL | / #![warn(clippy::missing_docs_in_private_items)]
|
||||||
LL | |
|
... |
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | | fn main() {}
|
LL | | fn main() {}
|
||||||
| |____________^
|
| |____________^
|
||||||
|
|
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | |
|
||||||
LL | | // unused field: hidden
|
LL | | // unused field: hidden
|
||||||
LL | | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
LL | | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -28,7 +27,6 @@ LL | |
|
||||||
LL | | // unused fields: hidden, hidden2, hidden4
|
LL | | // unused fields: hidden, hidden2, hidden4
|
||||||
LL | | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
LL | | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -58,7 +56,6 @@ LL | |
|
||||||
LL | | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
LL | | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
LL | | let mut f = formatter.debug_struct("MultiExprDebugImpl");
|
LL | | let mut f = formatter.debug_struct("MultiExprDebugImpl");
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | |
|
||||||
LL | |
|
LL | |
|
||||||
LL | | if *v == 10 {
|
LL | | if *v == 10 {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | });
|
LL | | });
|
||||||
| |_______^
|
| |_______^
|
||||||
|
|
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ error: this `if` branch is empty
|
||||||
LL | / if {
|
LL | / if {
|
||||||
LL | | if let true = true
|
LL | | if let true = true
|
||||||
LL | | && true
|
LL | | && true
|
||||||
LL | | {
|
|
||||||
... |
|
... |
|
||||||
LL | | } && true
|
LL | | } && true
|
||||||
LL | | {}
|
LL | | {}
|
||||||
|
|
|
@ -2,9 +2,6 @@ error: this loop never actually loops
|
||||||
--> tests/ui/never_loop.rs:12:5
|
--> tests/ui/never_loop.rs:12:5
|
||||||
|
|
|
|
||||||
LL | / loop {
|
LL | / loop {
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | | // clippy::never_loop
|
|
||||||
... |
|
... |
|
||||||
LL | | break;
|
LL | | break;
|
||||||
LL | | }
|
LL | | }
|
||||||
|
@ -75,7 +72,6 @@ LL | |
|
||||||
LL | | // never loops
|
LL | | // never loops
|
||||||
LL | | match x {
|
LL | | match x {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -126,7 +122,6 @@ LL | |
|
||||||
LL | | 'b: {
|
LL | | 'b: {
|
||||||
LL | | break 'b 'c: {
|
LL | | break 'b 'c: {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
||||||
|
|
|
@ -115,8 +115,7 @@ LL | let _ = if let Some(x) = arg {
|
||||||
| _____________^
|
| _____________^
|
||||||
LL | | x
|
LL | | x
|
||||||
LL | | } else {
|
LL | | } else {
|
||||||
LL | | // map_or_else must be suggested
|
... |
|
||||||
LL | | side_effect()
|
|
||||||
LL | | };
|
LL | | };
|
||||||
| |_____^ help: try: `arg.map_or_else(side_effect, |x| x)`
|
| |_____^ help: try: `arg.map_or_else(side_effect, |x| x)`
|
||||||
|
|
||||||
|
|
|
@ -183,8 +183,7 @@ error: this block may be rewritten with the `?` operator
|
||||||
|
|
|
|
||||||
LL | / if a.is_none() {
|
LL | / if a.is_none() {
|
||||||
LL | | return None;
|
LL | | return None;
|
||||||
LL | | // do lint here, the outer `try` is not relevant here
|
... |
|
||||||
LL | | // https://github.com/rust-lang/rust-clippy/pull/11001#issuecomment-1610636867
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____________^ help: replace it with: `a?;`
|
| |_____________^ help: replace it with: `a?;`
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,7 @@ LL | pub fn complex_return_triggers_the_lint() -> i32 {
|
||||||
| __________________________________________________-
|
| __________________________________________________-
|
||||||
LL | | fn foo() -> i32 {
|
LL | | fn foo() -> i32 {
|
||||||
LL | | 1
|
LL | | 1
|
||||||
LL | | }
|
... |
|
||||||
LL | | let mutex = Mutex::new(1);
|
|
||||||
LL | | let lock = mutex.lock().unwrap();
|
LL | | let lock = mutex.lock().unwrap();
|
||||||
| | ^^^^
|
| | ^^^^
|
||||||
... |
|
... |
|
||||||
|
|
|
@ -22,10 +22,7 @@ error: you seem to be trying to use `match` for destructuring a single pattern.
|
||||||
--> tests/ui/single_match.rs:23:5
|
--> tests/ui/single_match.rs:23:5
|
||||||
|
|
|
|
||||||
LL | / match x {
|
LL | / match x {
|
||||||
LL | | // Note the missing block braces.
|
... |
|
||||||
LL | | // We suggest `if let Some(y) = x { .. }` because the macro
|
|
||||||
LL | | // is expanded before we can do anything.
|
|
||||||
LL | | Some(y) => println!("{:?}", y),
|
|
||||||
LL | | _ => (),
|
LL | | _ => (),
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^ help: try: `if let Some(y) = x { println!("{:?}", y) }`
|
| |_____^ help: try: `if let Some(y) = x { println!("{:?}", y) }`
|
||||||
|
|
|
@ -68,8 +68,7 @@ LL | / match Result::<i32, &Infallible>::Ok(1) {
|
||||||
LL | | Ok(a) => println!("${:?}", a),
|
LL | | Ok(a) => println!("${:?}", a),
|
||||||
LL | | Err(_) => {
|
LL | | Err(_) => {
|
||||||
LL | | println!("else block");
|
LL | | println!("else block");
|
||||||
LL | | return;
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
@ -88,8 +87,7 @@ LL | / match Cow::from("moo") {
|
||||||
LL | | Cow::Owned(a) => println!("${:?}", a),
|
LL | | Cow::Owned(a) => println!("${:?}", a),
|
||||||
LL | | Cow::Borrowed(_) => {
|
LL | | Cow::Borrowed(_) => {
|
||||||
LL | | println!("else block");
|
LL | | println!("else block");
|
||||||
LL | | return;
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
|
|
@ -13,8 +13,7 @@ error: assignment to temporary
|
||||||
LL | / MultiStruct {
|
LL | / MultiStruct {
|
||||||
LL | |
|
LL | |
|
||||||
LL | | structure: Struct { field: 0 },
|
LL | | structure: Struct { field: 0 },
|
||||||
LL | | }
|
... |
|
||||||
LL | | .structure
|
|
||||||
LL | | .field = 1;
|
LL | | .field = 1;
|
||||||
| |______________^
|
| |______________^
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ LL | |
|
||||||
LL | | {
|
LL | | {
|
||||||
LL | | true;
|
LL | | true;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | );
|
LL | | );
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
||||||
|
@ -46,7 +45,6 @@ LL | |
|
||||||
LL | | {
|
LL | | {
|
||||||
LL | | true;
|
LL | | true;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | );
|
LL | | );
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
||||||
|
@ -58,7 +56,6 @@ LL | |
|
||||||
LL | | {
|
LL | | {
|
||||||
LL | | true;
|
LL | | true;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | );
|
LL | | );
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
||||||
|
@ -70,7 +67,6 @@ LL | |
|
||||||
LL | | {
|
LL | | {
|
||||||
LL | | true;
|
LL | | true;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | );
|
LL | | );
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
||||||
|
|
|
@ -434,11 +434,7 @@ error: unnecessary closure used to substitute value for `Result::Err`
|
||||||
|
|
|
|
||||||
LL | let _: Result<usize, usize> = res.
|
LL | let _: Result<usize, usize> = res.
|
||||||
| ___________________________________^
|
| ___________________________________^
|
||||||
LL | | // some lines
|
|
||||||
LL | | // some lines
|
|
||||||
LL | | // some lines
|
|
||||||
... |
|
... |
|
||||||
LL | | // some lines
|
|
||||||
LL | | or_else(|_| Ok(ext_str.some_field));
|
LL | | or_else(|_| Ok(ext_str.some_field));
|
||||||
| |_______________________________________^
|
| |_______________________________________^
|
||||||
|
|
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | |
|
||||||
LL | |
|
LL | |
|
||||||
LL | | if a && b {
|
LL | | if a && b {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -112,7 +111,6 @@ LL | |
|
||||||
LL | | if a && b {
|
LL | | if a && b {
|
||||||
LL | | return Some(());
|
LL | | return Some(());
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
@ -139,7 +137,6 @@ LL | |
|
||||||
LL | | if a && b {
|
LL | | if a && b {
|
||||||
LL | | return Ok(());
|
LL | | return Ok(());
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | |
|
||||||
LL | | // checks whether a string represents a number divisible by 3
|
LL | | // checks whether a string represents a number divisible by 3
|
||||||
LL | | let i = i_str.parse::<i32>().unwrap();
|
LL | | let i = i_str.parse::<i32>().unwrap();
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
|
||||||
|
|
|
@ -2,8 +2,7 @@ error: calls to `push` immediately after creation
|
||||||
--> tests/ui/vec_init_then_push.rs:5:5
|
--> tests/ui/vec_init_then_push.rs:5:5
|
||||||
|
|
|
|
||||||
LL | / let mut def_err: Vec<u32> = Default::default();
|
LL | / let mut def_err: Vec<u32> = Default::default();
|
||||||
LL | |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | def_err.push(0);
|
LL | | def_err.push(0);
|
||||||
| |____________________^ help: consider using the `vec![]` macro: `let def_err: Vec<u32> = vec![..];`
|
| |____________________^ help: consider using the `vec![]` macro: `let def_err: Vec<u32> = vec![..];`
|
||||||
|
|
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | |
|
||||||
LL | |
|
LL | |
|
||||||
LL | | if let Some(_x) = y {
|
LL | | if let Some(_x) = y {
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^ help: try: `while let Some(_x) = y { .. }`
|
| |_____^ help: try: `while let Some(_x) = y { .. }`
|
||||||
|
|
|
|
||||||
|
@ -45,7 +44,6 @@ LL | |
|
||||||
LL | | let x = match y {
|
LL | | let x = match y {
|
||||||
LL | | Some(x) => x,
|
LL | | Some(x) => x,
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^ help: try: `while let Some(x) = y { .. }`
|
| |_____^ help: try: `while let Some(x) = y { .. }`
|
||||||
|
|
||||||
|
|
|
@ -149,10 +149,9 @@ pub fn iter_exported_symbols<'tcx>(
|
||||||
let dependency_formats = tcx.dependency_formats(());
|
let dependency_formats = tcx.dependency_formats(());
|
||||||
// Find the dependencies of the executable we are running.
|
// Find the dependencies of the executable we are running.
|
||||||
let dependency_format = dependency_formats
|
let dependency_format = dependency_formats
|
||||||
.iter()
|
.get(&CrateType::Executable)
|
||||||
.find(|(crate_type, _)| *crate_type == CrateType::Executable)
|
|
||||||
.expect("interpreting a non-executable crate");
|
.expect("interpreting a non-executable crate");
|
||||||
for cnum in dependency_format.1.iter().enumerate().filter_map(|(num, &linkage)| {
|
for cnum in dependency_format.iter().enumerate().filter_map(|(num, &linkage)| {
|
||||||
// We add 1 to the number because that's what rustc also does everywhere it
|
// We add 1 to the number because that's what rustc also does everywhere it
|
||||||
// calls `CrateNum::new`...
|
// calls `CrateNum::new`...
|
||||||
#[expect(clippy::arithmetic_side_effects)]
|
#[expect(clippy::arithmetic_side_effects)]
|
||||||
|
|
|
@ -24,8 +24,7 @@ note: inside `main`
|
||||||
LL | / thread::spawn(|| {
|
LL | / thread::spawn(|| {
|
||||||
LL | | unsafe {
|
LL | | unsafe {
|
||||||
LL | | assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0);
|
LL | | assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0);
|
||||||
LL | | }
|
... |
|
||||||
LL | | })
|
|
||||||
LL | | .join()
|
LL | | .join()
|
||||||
| |___________^
|
| |___________^
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ LL | | let _unit: ();
|
||||||
LL | | {
|
LL | | {
|
||||||
LL | | let non_copy = S(42);
|
LL | | let non_copy = S(42);
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: <TAG> is this argument
|
help: <TAG> is this argument
|
||||||
|
|
|
@ -16,7 +16,6 @@ LL | | let _unit: ();
|
||||||
LL | | {
|
LL | | {
|
||||||
LL | | let non_copy = S(42);
|
LL | | let non_copy = S(42);
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: the protected tag <TAG> was created here, in the initial state Reserved
|
help: the protected tag <TAG> was created here, in the initial state Reserved
|
||||||
|
|
|
@ -14,7 +14,6 @@ LL | | let _unit: ();
|
||||||
LL | | {
|
LL | | {
|
||||||
LL | | let non_copy = S(42);
|
LL | | let non_copy = S(42);
|
||||||
... |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: <TAG> is this argument
|
help: <TAG> is this argument
|
||||||
|
|
|
@ -16,7 +16,6 @@ LL | | let _unit: ();
|
||||||
LL | | {
|
LL | | {
|
||||||
LL | | let non_copy = S(42);
|
LL | | let non_copy = S(42);
|
||||||
... |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: the protected tag <TAG> was created here, in the initial state Reserved
|
help: the protected tag <TAG> was created here, in the initial state Reserved
|
||||||
|
|
|
@ -14,7 +14,6 @@ LL | | {
|
||||||
LL | | let x = 0;
|
LL | | let x = 0;
|
||||||
LL | | let ptr = &raw mut x;
|
LL | | let ptr = &raw mut x;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: <TAG> is this argument
|
help: <TAG> is this argument
|
||||||
|
|
|
@ -16,7 +16,6 @@ LL | | {
|
||||||
LL | | let x = 0;
|
LL | | let x = 0;
|
||||||
LL | | let ptr = &raw mut x;
|
LL | | let ptr = &raw mut x;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: the protected tag <TAG> was created here, in the initial state Reserved
|
help: the protected tag <TAG> was created here, in the initial state Reserved
|
||||||
|
|
|
@ -14,7 +14,6 @@ LL | | {
|
||||||
LL | | let _x = 0;
|
LL | | let _x = 0;
|
||||||
LL | | let ptr = &raw mut _x;
|
LL | | let ptr = &raw mut _x;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: <TAG> is this argument
|
help: <TAG> is this argument
|
||||||
|
|
|
@ -16,7 +16,6 @@ LL | | {
|
||||||
LL | | let _x = 0;
|
LL | | let _x = 0;
|
||||||
LL | | let ptr = &raw mut _x;
|
LL | | let ptr = &raw mut _x;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: the protected tag <TAG> was created here, in the initial state Reserved
|
help: the protected tag <TAG> was created here, in the initial state Reserved
|
||||||
|
|
|
@ -14,7 +14,6 @@ LL | | {
|
||||||
LL | | let _x = 0;
|
LL | | let _x = 0;
|
||||||
LL | | let ptr = &raw mut _x;
|
LL | | let ptr = &raw mut _x;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: <TAG> is this argument
|
help: <TAG> is this argument
|
||||||
|
|
|
@ -16,7 +16,6 @@ LL | | {
|
||||||
LL | | let _x = 0;
|
LL | | let _x = 0;
|
||||||
LL | | let ptr = &raw mut _x;
|
LL | | let ptr = &raw mut _x;
|
||||||
... |
|
... |
|
||||||
LL | | }
|
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
help: the protected tag <TAG> was created here, in the initial state Reserved
|
help: the protected tag <TAG> was created here, in the initial state Reserved
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
//@ known-bug: #123861
|
|
||||||
//@ needs-rustc-debug-assertions
|
|
||||||
|
|
||||||
struct _;
|
|
||||||
fn mainIterator<_ = _> {}
|
|
12
tests/crashes/133426.rs
Normal file
12
tests/crashes/133426.rs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
//@ known-bug: #133426
|
||||||
|
|
||||||
|
fn a(
|
||||||
|
_: impl Iterator<
|
||||||
|
Item = [(); {
|
||||||
|
match *todo!() { ! };
|
||||||
|
}],
|
||||||
|
>,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
fn b(_: impl Iterator<Item = { match 0 { ! } }>) {}
|
11
tests/crashes/133597.rs
Normal file
11
tests/crashes/133597.rs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
//@ known-bug: #133597
|
||||||
|
|
||||||
|
pub trait Foo2 {
|
||||||
|
fn boxed<'a: 'a>() -> impl Sized + FnOnce<()>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Foo2 for () {}
|
||||||
|
|
||||||
|
|
||||||
|
fn f() -> impl FnOnce<()> { || () }
|
||||||
|
fn main() { () = f(); }
|
33
tests/crashes/133639.rs
Normal file
33
tests/crashes/133639.rs
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
//@ known-bug: #133639
|
||||||
|
|
||||||
|
#![feature(with_negative_coherence)]
|
||||||
|
#![feature(min_specialization)]
|
||||||
|
#![feature(generic_const_exprs)]
|
||||||
|
|
||||||
|
#![crate_type = "lib"]
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
struct a<const b: bool>;
|
||||||
|
|
||||||
|
trait c {}
|
||||||
|
|
||||||
|
impl<const d: u32> FromStr for e<d>
|
||||||
|
where
|
||||||
|
a<{ d <= 2 }>: c,
|
||||||
|
{
|
||||||
|
type Err = ();
|
||||||
|
fn from_str(f: &str) -> Result<Self, Self::Err> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
struct e<const d: u32>;
|
||||||
|
|
||||||
|
impl<const d: u32> FromStr for e<d>
|
||||||
|
where
|
||||||
|
a<{ d <= 2 }>: c,
|
||||||
|
{
|
||||||
|
type Err = ();
|
||||||
|
fn from_str(f: &str) -> Result<Self, Self::Err> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
}
|
15
tests/crashes/133808.rs
Normal file
15
tests/crashes/133808.rs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
//@ known-bug: #133808
|
||||||
|
|
||||||
|
#![feature(generic_const_exprs, transmutability)]
|
||||||
|
|
||||||
|
mod assert {
|
||||||
|
use std::mem::TransmuteFrom;
|
||||||
|
|
||||||
|
pub fn is_transmutable<Src, Dst>()
|
||||||
|
where
|
||||||
|
Dst: TransmuteFrom<Src>,
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn main() {}
|
13
tests/crashes/133868.rs
Normal file
13
tests/crashes/133868.rs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
//@ known-bug: #133868
|
||||||
|
|
||||||
|
trait Foo {
|
||||||
|
type Assoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
trait Bar {
|
||||||
|
fn method() -> impl Sized;
|
||||||
|
}
|
||||||
|
impl<T> Bar for T where <T as Foo>::Assoc: Sized
|
||||||
|
{
|
||||||
|
fn method() {}
|
||||||
|
}
|
9
tests/crashes/133965.rs
Normal file
9
tests/crashes/133965.rs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
//@ known-bug: #133965
|
||||||
|
//@ needs-rustc-debug-assertions
|
||||||
|
|
||||||
|
struct NonGeneric {}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
struct NonGeneric<'a, const N: usize> {}
|
||||||
|
|
||||||
|
pub fn main() {}
|
3
tests/crashes/133966.rs
Normal file
3
tests/crashes/133966.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
//@ known-bug: #133966
|
||||||
|
pub struct Data([[&'static str]; 5_i32]);
|
||||||
|
const _: &'static Data = unsafe { &*(&[] as *const Data) };
|
5
tests/crashes/134005.rs
Normal file
5
tests/crashes/134005.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
//@ known-bug: #134005
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let _ = [std::ops::Add::add, std::ops::Mul::mul, main as fn(_, &_)];
|
||||||
|
}
|
4
tests/crashes/134061.rs
Normal file
4
tests/crashes/134061.rs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
//@ known-bug: #134061
|
||||||
|
//@ needs-rustc-debug-assertions
|
||||||
|
|
||||||
|
const x: () = |&'a
|
8
tests/crashes/134162.rs
Normal file
8
tests/crashes/134162.rs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
//@ known-bug: #134162
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
struct X;
|
||||||
|
|
||||||
|
let xs = [X, X, X];
|
||||||
|
let eq = xs == [panic!("panic evaluated"); 2];
|
||||||
|
}
|
9
tests/crashes/134217.rs
Normal file
9
tests/crashes/134217.rs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
//@ known-bug: #134217
|
||||||
|
|
||||||
|
impl<A> std::ops::CoerceUnsized<A> for A {}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
if let _ = true
|
||||||
|
&& true
|
||||||
|
{}
|
||||||
|
}
|
|
@ -4,6 +4,6 @@
|
||||||
const EXPECTED = {
|
const EXPECTED = {
|
||||||
'query': 'OsString -> String',
|
'query': 'OsString -> String',
|
||||||
'others': [
|
'others': [
|
||||||
{ 'path': 'std::ffi::os_str::OsString', 'name': 'into_string' },
|
{ 'path': 'std::ffi::OsString', 'name': 'into_string' },
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,4 +14,13 @@ const EXPECTED = [
|
||||||
{ 'path': 'reexport', 'name': 'AnotherOne' },
|
{ 'path': 'reexport', 'name': 'AnotherOne' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'query': 'fn:Equivalent::equivalent',
|
||||||
|
'others': [
|
||||||
|
// These results must never contain `reexport::equivalent::NotEquivalent`,
|
||||||
|
// since that path does not exist.
|
||||||
|
{ 'path': 'equivalent::Equivalent', 'name': 'equivalent' },
|
||||||
|
{ 'path': 'reexport::NotEquivalent', 'name': 'equivalent' },
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,6 +2,15 @@
|
||||||
// This is a DWIM case, since renaming the export probably means the intent is also different.
|
// This is a DWIM case, since renaming the export probably means the intent is also different.
|
||||||
// For the de-duplication case of exactly the same name, see reexport-dedup
|
// For the de-duplication case of exactly the same name, see reexport-dedup
|
||||||
|
|
||||||
|
//@ aux-crate:equivalent=equivalent.rs
|
||||||
|
//@ compile-flags: --extern equivalent
|
||||||
|
//@ aux-build:equivalent.rs
|
||||||
|
//@ build-aux-docs
|
||||||
|
#[doc(inline)]
|
||||||
|
pub extern crate equivalent;
|
||||||
|
#[doc(inline)]
|
||||||
|
pub use equivalent::Equivalent as NotEquivalent;
|
||||||
|
|
||||||
pub mod fmt {
|
pub mod fmt {
|
||||||
pub struct Subscriber;
|
pub struct Subscriber;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ error: unclosed quote string `"`
|
||||||
LL | / /// ```{class="}
|
LL | / /// ```{class="}
|
||||||
LL | | /// main;
|
LL | | /// main;
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// main;
|
LL | | /// main;
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -23,7 +22,6 @@ error: unclosed quote string `"`
|
||||||
LL | / /// ```{class="}
|
LL | / /// ```{class="}
|
||||||
LL | | /// main;
|
LL | | /// main;
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// main;
|
LL | | /// main;
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
|
|
@ -308,19 +308,12 @@ LL | pub trait SVec: Index<
|
||||||
| | |
|
| | |
|
||||||
| | this trait cannot be made into an object...
|
| | this trait cannot be made into an object...
|
||||||
LL | | <Self as SVec>::Item,
|
LL | | <Self as SVec>::Item,
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | |/ Output = <Index<<Self as SVec>::Item,
|
LL | |/ Output = <Index<<Self as SVec>::Item,
|
||||||
LL | ||
|
|
||||||
LL | ||
|
|
||||||
LL | ||
|
|
||||||
... ||
|
... ||
|
||||||
LL | ||
|
|
||||||
LL | || Output = <Self as SVec>::Item> as SVec>::Item,
|
LL | || Output = <Self as SVec>::Item> as SVec>::Item,
|
||||||
| ||_________________________________________________^ ...because it uses `Self` as a type parameter
|
| ||_________________________________________________^ ...because it uses `Self` as a type parameter
|
||||||
... |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | > {
|
LL | | > {
|
||||||
| |__^ ...because it uses `Self` as a type parameter
|
| |__^ ...because it uses `Self` as a type parameter
|
||||||
help: consider using an opaque type instead
|
help: consider using an opaque type instead
|
||||||
|
|
|
@ -2,9 +2,6 @@ error: unknown attribute `compile-fail`
|
||||||
--> $DIR/check-attr.rs:3:1
|
--> $DIR/check-attr.rs:3:1
|
||||||
|
|
|
|
||||||
LL | / /// foo
|
LL | / /// foo
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -22,9 +19,6 @@ error: unknown attribute `compilefail`
|
||||||
--> $DIR/check-attr.rs:3:1
|
--> $DIR/check-attr.rs:3:1
|
||||||
|
|
|
|
||||||
LL | / /// foo
|
LL | / /// foo
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -37,9 +31,6 @@ error: unknown attribute `comPile_fail`
|
||||||
--> $DIR/check-attr.rs:3:1
|
--> $DIR/check-attr.rs:3:1
|
||||||
|
|
|
|
||||||
LL | / /// foo
|
LL | / /// foo
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -52,9 +43,6 @@ error: unknown attribute `should-panic`
|
||||||
--> $DIR/check-attr.rs:13:1
|
--> $DIR/check-attr.rs:13:1
|
||||||
|
|
|
|
||||||
LL | / /// bar
|
LL | / /// bar
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -67,9 +55,6 @@ error: unknown attribute `shouldpanic`
|
||||||
--> $DIR/check-attr.rs:13:1
|
--> $DIR/check-attr.rs:13:1
|
||||||
|
|
|
|
||||||
LL | / /// bar
|
LL | / /// bar
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -82,9 +67,6 @@ error: unknown attribute `sHould_panic`
|
||||||
--> $DIR/check-attr.rs:13:1
|
--> $DIR/check-attr.rs:13:1
|
||||||
|
|
|
|
||||||
LL | / /// bar
|
LL | / /// bar
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -97,9 +79,6 @@ error: unknown attribute `no-run`
|
||||||
--> $DIR/check-attr.rs:23:1
|
--> $DIR/check-attr.rs:23:1
|
||||||
|
|
|
|
||||||
LL | / /// foobar
|
LL | / /// foobar
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -112,9 +91,6 @@ error: unknown attribute `norun`
|
||||||
--> $DIR/check-attr.rs:23:1
|
--> $DIR/check-attr.rs:23:1
|
||||||
|
|
|
|
||||||
LL | / /// foobar
|
LL | / /// foobar
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -127,9 +103,6 @@ error: unknown attribute `no_Run`
|
||||||
--> $DIR/check-attr.rs:23:1
|
--> $DIR/check-attr.rs:23:1
|
||||||
|
|
|
|
||||||
LL | / /// foobar
|
LL | / /// foobar
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -142,9 +115,6 @@ error: unknown attribute `test-harness`
|
||||||
--> $DIR/check-attr.rs:33:1
|
--> $DIR/check-attr.rs:33:1
|
||||||
|
|
|
|
||||||
LL | / /// b
|
LL | / /// b
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -157,9 +127,6 @@ error: unknown attribute `testharness`
|
||||||
--> $DIR/check-attr.rs:33:1
|
--> $DIR/check-attr.rs:33:1
|
||||||
|
|
|
|
||||||
LL | / /// b
|
LL | / /// b
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
@ -172,9 +139,6 @@ error: unknown attribute `teSt_harness`
|
||||||
--> $DIR/check-attr.rs:33:1
|
--> $DIR/check-attr.rs:33:1
|
||||||
|
|
|
|
||||||
LL | / /// b
|
LL | / /// b
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
... |
|
||||||
LL | | /// boo
|
LL | | /// boo
|
||||||
LL | | /// ```
|
LL | | /// ```
|
||||||
|
|
|
@ -6,7 +6,6 @@ LL | |
|
||||||
LL | |
|
LL | |
|
||||||
LL | | #![warn(missing_docs)]
|
LL | | #![warn(missing_docs)]
|
||||||
... |
|
... |
|
||||||
LL | |
|
|
||||||
LL | | pub fn foo() {}
|
LL | | pub fn foo() {}
|
||||||
| |_______________^
|
| |_______________^
|
||||||
|
|
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue