Skip to content

Rollup of 5 pull requests #84005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 162 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
d3915c5
Fix spacing in docs for `core::pin` by combining consequent code bloc…
steffahn Jan 5, 2021
ceaeb24
Exclude single type parameters from links in `core::pin` for more vis…
steffahn Jan 5, 2021
87ac118
Add more links to `core::pin` to improve visual consistency.
steffahn Jan 5, 2021
e65385f
Fix broken links to `Drop` that used to point to `Drop::drop` due to …
steffahn Jan 5, 2021
684edf7
Add titles (tooltips) to defined links in `core::pin`.
steffahn Jan 5, 2021
3e0cef7
Fix overlength lines in `core::pin`.
steffahn Jan 5, 2021
9f6b5de
Merge commit '0e87918536b9833bbc6c683d1f9d51ee2bf03ef1' into clippyup
flip1995 Mar 25, 2021
3a4c0a7
Updated changelog for 1.52
xFrednet Mar 24, 2021
f41d68f
Auto merge of #6961 - xFrednet:changelog-1-52, r=flip1995
bors Mar 25, 2021
0ff68bb
Improve `redundant_slicing`
Jarcho Mar 26, 2021
63aca96
Auto merge of #6975 - Jarcho:redundant_slicing_fp, r=llogiq
bors Mar 26, 2021
caa49c8
Move absurd_extreme_comparisons to its own module
Y-Nak Mar 18, 2021
f231b59
Move invalid_upcast_comparisons to its own module
Y-Nak Mar 18, 2021
dad39b6
Move implicit_hasher to its own module
Y-Nak Mar 18, 2021
494bc8a
Fix FN that types lints don't work with const or static
Y-Nak Mar 19, 2021
bd1201a
Fix inconsistent test names
Y-Nak Mar 19, 2021
818f832
Merge type_complexity pass into types pass
Y-Nak Mar 20, 2021
1a1adad
Add MSRV option to unnested_or_patterns lint
flip1995 Mar 26, 2021
9ce9989
Improve doc on how to add MSRV to a lint
flip1995 Mar 26, 2021
5279b59
Fix trailing whitespaces in doc/adding_lints.md
flip1995 Mar 26, 2021
6f2a6fe
Auto merge of #6977 - flip1995:or_patterns_msrv, r=llogiq
bors Mar 26, 2021
5351bbf
Add missing lints to MSRV config doc
flip1995 Mar 26, 2021
0dddfbf
Use iter::zip in src/tools/clippy/
cuviper Mar 8, 2021
abcbe54
Stabilize `peekable_peek_mut`
lukaslueg Feb 9, 2021
4e19d40
upper_case_acronyms: only lint enum variants if the enum is not public
matthiaskrgr Mar 26, 2021
ca7e955
upper_case_acronyms: add ui and ui-toml tests for private/public enums
matthiaskrgr Mar 26, 2021
ce4e668
format macro argument parsing fix
osa1 Mar 21, 2021
12985af
`len_without_is_empty` improvements
Jarcho Mar 26, 2021
dcee00d
Auto merge of #6980 - Jarcho:len_without_is_empty_sig, r=llogiq
bors Mar 27, 2021
8e56a2b
Auto merge of #6979 - flip1995:msrv_doc_fix, r=giraffate
bors Mar 27, 2021
febf34e
Move too_many_arguments to its own module
Y-Nak Mar 24, 2021
7c028de
Move too_many_lines to its own module
Y-Nak Mar 24, 2021
9782fc4
move not_unsafe_ptr_arg_deref to its own module
Y-Nak Mar 27, 2021
c379165
Move lints related to must_use to their own module
Y-Nak Mar 27, 2021
add3e50
Move result_unit_err to its own module
Y-Nak Mar 27, 2021
b094bb1
Rollup merge of #82917 - cuviper:iter-zip, r=m-ou-se
Dylan-DPC Mar 27, 2021
e006c77
redundant_pattern_matching: look inside Refs
matthiaskrgr Mar 27, 2021
a57a8c3
Remove (lots of) dead code
jyn514 Mar 16, 2021
879fa5c
Improve `expl_impl_clone_on_copy`
Jarcho Mar 28, 2021
4bcc552
Auto merge of #6991 - matthiaskrgr:5396, r=giraffate
bors Mar 28, 2021
c07103b
Auto merge of #6993 - Jarcho:expl_impl_clone, r=llogiq
bors Mar 28, 2021
1f95940
Fix inconsistent test name
Y-Nak Mar 29, 2021
31afdfc
missing_panics_doc: Ignore usage of debug_assert family
Y-Nak Mar 29, 2021
0e06b3c
Auto merge of #6996 - Y-Nak:missing_panics_doc, r=Manishearth
bors Mar 29, 2021
d265776
Improve `clone_on_copy`
Jarcho Mar 29, 2021
23508a1
Use uppercase for MSRV
giraffate Mar 29, 2021
a521445
Auto merge of #7003 - giraffate:use_uppercase_for_msrv, r=camsteffen
bors Mar 30, 2021
541c8b8
Improve documents in functions group
Y-Nak Mar 30, 2021
1ddeaa6
Auto merge of #6990 - Y-Nak:refactor-functions, r=giraffate
bors Mar 30, 2021
0552852
Auto merge of #7000 - Jarcho:clone_on_copy_fp, r=llogiq
bors Mar 30, 2021
6966c78
wrong_self_convention: fix FP inside trait impl for `to_*` method
mgacek8 Mar 29, 2021
fa689f8
Fix `manual_map` at the end of an if chain
Jarcho Mar 30, 2021
44bf60f
Auto merge of #7004 - Jarcho:manual_map_if_then_else, r=camsteffen
bors Mar 30, 2021
cc7f1da
Don't lint `manual_map` in const functions
Jarcho Mar 26, 2021
d121b34
Remove hir::CrateItem.
cjgillot Mar 30, 2021
7fcd155
Add non_octal_unix_permissions lint
ebobrow Mar 29, 2021
4be72b0
Auto merge of #7001 - ebobrow:non-octal-file-permissions, r=Manishearth
bors Mar 30, 2021
45164de
result_unit_err: Fix typo
Y-Nak Mar 31, 2021
0b76719
Auto merge of #7007 - Y-Nak:result_unit_err, r=giraffate
bors Mar 31, 2021
8abab55
Fix hidden variant suggestion on single variant
Mar 27, 2021
6ee1469
update lintcheck logs
matthiaskrgr Mar 31, 2021
225f7e0
lintcheck: warn if checking a program results in bad exit status
matthiaskrgr Mar 31, 2021
b438e30
Track bound vars
jackh726 Oct 6, 2020
2e33bf6
Auto merge of #6938 - Y-Nak:refactor-types, r=flip1995
bors Mar 31, 2021
3e42c35
Auto merge of #6981 - matthiaskrgr:6803_take_2, r=flip1995
bors Mar 31, 2021
5029dc8
New Lint: excessive_for_each
Y-Nak Feb 8, 2021
3095253
Fix codes that fails dogfood
Y-Nak Feb 9, 2021
54a0471
Change a category of excessive_for_each: Style -> Restriction
Y-Nak Feb 9, 2021
5bb0f16
Trigger the lint iff exposure's body is ExprKind::Block.
Y-Nak Feb 9, 2021
90cbbb2
Avoid to suggest using label
Y-Nak Feb 11, 2021
ccd7a60
Refactor: Remove duplicated codes from excessive_for_each
Y-Nak Feb 22, 2021
25d8b94
Add comments to clarify why RetCollector is needed
Y-Nak Feb 23, 2021
3843171
Improve the document of excessive_for_each
Y-Nak Feb 27, 2021
5543c34
Use ".." as default value of snippet in excessive_for_each
Y-Nak Feb 27, 2021
527fbbe
Refactor excessive_for_each
Y-Nak Mar 12, 2021
f2cc995
Remove method_calls
Y-Nak Mar 13, 2021
1109dc8
Fix codes that make dogfood fail
Y-Nak Mar 13, 2021
bf1e3f7
Skip needless_for_each if an input stmt is local
Y-Nak Mar 14, 2021
e61f978
Tweak a suggestion message of needless_for_each
Y-Nak Mar 15, 2021
56fbbf7
Suggest `flatten` instead of `is_some` -> `unwrap`
Nov 15, 2020
c1021b8
Auto merge of #6706 - Y-Nak:excessive-for-each, r=camsteffen
bors Mar 31, 2021
775ef47
Auto merge of #6342 - bbqbaron:issue-6061, r=flip1995
bors Mar 31, 2021
2108387
Destructure args in methods module
camsteffen Mar 11, 2021
487c2e8
Auto merge of #6913 - camsteffen:method-chain, r=flip1995
bors Mar 31, 2021
459bca8
Auto merge of #7008 - matthiaskrgr:ltchk, r=camsteffen
bors Mar 31, 2021
5f887d0
Add if_chain lints
camsteffen Mar 30, 2021
827d6aa
Eat dogfood
camsteffen Mar 30, 2021
aaba9b7
Fix `redundant_clone` fp where the cloned value is modified while the…
Jarcho Mar 31, 2021
8cf7d9b
Auto merge of #7010 - camsteffen:if-chain-lint, r=llogiq
bors Mar 31, 2021
6325fe1
clippy_utils: fix needless parenthesis output from sugg::Sugg::maybe_par
Y-Nak Apr 1, 2021
75d73e9
Auto merge of #6976 - Jarcho:manual_map_const, r=phansch
bors Apr 1, 2021
38b1fd0
Auto merge of #7002 - mgacek8:issue6983_wrong_self_convention_inside_…
bors Apr 1, 2021
92c4fc3
Auto merge of #7011 - Jarcho:redundant_clone_fp, r=flip1995
bors Apr 1, 2021
72eb60a
Auto merge of #7013 - Y-Nak:fix-needless-paren, r=flip1995
bors Apr 1, 2021
08a8ad3
Remove paths from bind_instead_of_map
camsteffen Apr 1, 2021
9f6f001
same_item_push: Don't trigger same_item_push if the vec is used in th…
Y-Nak Apr 2, 2021
1931db2
Auto merge of #6988 - mikerite:fix-6984, r=camsteffen
bors Apr 2, 2021
a064534
Refactor needless_collect
camsteffen Apr 2, 2021
4356a8f
Remove redundant emit()
camsteffen Apr 2, 2021
9ce2373
Auto merge of #7016 - camsteffen:bind-map-paths, r=Manishearth
bors Apr 2, 2021
33798bb
Improve needless_collect output
camsteffen Apr 2, 2021
86fb0e8
Auto merge of #7020 - camsteffen:needless-collect, r=Manishearth
bors Apr 2, 2021
2ca5368
fix clippy error
roxelo Mar 30, 2021
c726448
Remove attribute `#[link_args]`
petrochenkov Apr 3, 2021
7014340
Fix ICE
camsteffen Apr 2, 2021
5102c9c
Remove author requirement for `cargo_common_metadata`
daxpedda Apr 3, 2021
6f31ed6
Use DefIdMap and similar aliases
camsteffen Mar 31, 2021
984ab98
added core::panicking::assert_failed_inner as panicking
ABouttefeux Apr 4, 2021
2f81e4e
modification not working: fixing
ABouttefeux Apr 4, 2021
e25b106
Adding a dark theme to the clippy lint list
xFrednet Apr 2, 2021
6bb608c
Auto merge of #7030 - xFrednet:6877-clippy-going-dark, r=llogiq
bors Apr 4, 2021
da04e87
Quick fix to access the correct css files
xFrednet Apr 4, 2021
44e3ccb
Rollup merge of #83820 - petrochenkov:nolinkargs, r=nagisa
Dylan-DPC Apr 4, 2021
a15d987
Auto merge of #7021 - camsteffen:7012, r=giraffate
bors Apr 4, 2021
a00de90
Fix ICE in `missing_panics_doc`
Jarcho Apr 5, 2021
8e5dd4b
add test for missing_panic_doc on assert_eq/assert_ne
ABouttefeux Apr 5, 2021
e315437
Auto merge of #7031 - xFrednet:5234-quick-fix-dark-mode-themes, r=llogiq
bors Apr 5, 2021
8d221c5
Auto merge of #7027 - camsteffen:defidmap, r=phansch
bors Apr 5, 2021
81f9946
Auto merge of #7034 - Jarcho:missing_doc_ice, r=phansch
bors Apr 5, 2021
232e2b7
Added documentation to the multispan_sugg method
xFrednet Jan 5, 2021
d1df732
A new lint for shared code in if blocks
xFrednet Dec 11, 2020
469ff96
The shared_code_in_if_blocks lint only operats on entire if expr not …
xFrednet Jan 13, 2021
8efc6ac
Improved shared_code_in_if_blocks output readability and added tests
xFrednet Jan 16, 2021
b1d26e5
Improved shared_code_in_if_blocks message and added test stderrs
xFrednet Jan 16, 2021
65ed5a6
Updated code for dogfood
xFrednet Jan 16, 2021
c74e49e
Adapted the lint to use the new SpanlessEq
xFrednet Feb 23, 2021
617c65b
Moving shared_code_in_if_blocks to clippy::complexity and running lin…
xFrednet Feb 25, 2021
8c0b4d7
Only running shared_code_in_if_blocks only for if statements
xFrednet Feb 26, 2021
7c9e192
Test for empty blocks and update from master
xFrednet Mar 5, 2021
a6f54f5
Renaming the lint to branches_sharing_code and fixing typos
xFrednet Apr 1, 2021
1a45e43
Auto merge of #7026 - daxpedda:cargo-author, r=camsteffen
bors Apr 5, 2021
d91da40
Auto merge of #6463 - xFrednet:5234-shared-code-in-if-blocks, r=phansch
bors Apr 5, 2021
25c1ed3
Auto merge of #7029 - ABouttefeux:master, r=Manishearth
bors Apr 5, 2021
57406c9
Auto merge of #7018 - Y-Nak:same_item_push, r=Manishearth
bors Apr 5, 2021
8a50923
consider mutability on useless_vec suggestions
hmacias-avaya Apr 5, 2021
879bfec
Use AnonConst for asm! constants
Amanieu Apr 6, 2021
d2ba777
Auto merge of #7036 - horacimacias:master, r=giraffate
bors Apr 6, 2021
12fce55
Fix all occurences of `needless_borrow` internally
Jarcho Apr 2, 2021
6ae0835
Auto merge of #6931 - Jarcho:needless_borrow, r=phansch,flip1995
bors Apr 6, 2021
7f32fda
Update library/core/src/iter/adapters/peekable.rs
lukaslueg Apr 6, 2021
72796a7
Merge branch 'master' into stab_peek_mut
lukaslueg Apr 6, 2021
1efb551
Remove get_node_span
camsteffen Apr 1, 2021
79d3082
Remove paths::PATH_BUF
camsteffen Apr 1, 2021
a342de3
Soft deprecate match_path and match_qpath
camsteffen Apr 6, 2021
bbe1567
Auto merge of #7043 - camsteffen:dead-utils, r=flip1995
bors Apr 6, 2021
624e8aa
Auto merge of #7044 - camsteffen:match-path, r=Manishearth
bors Apr 6, 2021
47f0c15
Symbol optimizations
camsteffen Mar 24, 2021
db6ea84
Auto merge of #7046 - camsteffen:symbol-optimize, r=giraffate
bors Apr 7, 2021
cde58f7
Rollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkov
Dylan-DPC Apr 7, 2021
4c850f3
Update library/core/src/iter/traits/iterator.rs
lukaslueg Apr 7, 2021
cfe43f9
Update library/core/src/iter/traits/iterator.rs
lukaslueg Apr 7, 2021
482a3d0
rustc: Add a new `wasm` ABI
alexcrichton Apr 1, 2021
ffa2b7d
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Apr 8, 2021
61eafbb
Bump nightly version -> 2021-04-08
flip1995 Apr 8, 2021
b40ea20
Auto merge of #7051 - flip1995:rustup, r=flip1995
bors Apr 8, 2021
6b37cd3
Merge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyup
flip1995 Apr 8, 2021
0019ca9
Fix outdated crate names in compiler docs
pierwill Apr 7, 2021
80b99d6
Rollup merge of #80733 - steffahn:prettify_pin_links, r=jyn514
Dylan-DPC Apr 8, 2021
5f6fb2c
Rollup merge of #81938 - lukaslueg:stab_peek_mut, r=Amanieu
Dylan-DPC Apr 8, 2021
2f4e2cb
Rollup merge of #83763 - alexcrichton:wasm-multivalue-abi, r=nagisa
Dylan-DPC Apr 8, 2021
27e52c0
Rollup merge of #83980 - pierwill:fix-compiler-librustc-names, r=davi…
Dylan-DPC Apr 8, 2021
7094eca
Rollup merge of #84001 - flip1995:clippyup, r=Manishearth
Dylan-DPC Apr 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/expand/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//! Definitions shared by macros / syntax extensions and e.g. librustc_middle.
//! Definitions shared by macros / syntax extensions and e.g. `rustc_middle`.

pub mod allocator;
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};

/// Requirements for a `StableHashingContext` to be used in this crate.
/// This is a hack to allow using the `HashStable_Generic` derive macro
/// instead of implementing everything in librustc_middle.
/// instead of implementing everything in `rustc_middle`.
pub trait HashStableContext: rustc_span::HashStableContext {
fn hash_attr(&mut self, _: &ast::Attribute, hasher: &mut StableHasher);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct LoweringContext<'a, 'hir: 'a> {

/// HACK(Centril): there is a cyclic dependency between the parser and lowering
/// if we don't have this function pointer. To avoid that dependency so that
/// librustc_middle is independent of the parser, we use dynamic dispatch here.
/// `rustc_middle` is independent of the parser, we use dynamic dispatch here.
nt_to_tokenstream: NtToTokenstream,

/// Used to allocate HIR nodes.
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ impl<'a> PostExpansionVisitor<'a> {
"thiscall-unwind ABI is experimental and subject to change"
);
}
"wasm" => {
gate_feature_post!(
&self,
wasm_abi,
span,
"wasm ABI is experimental and subject to change"
);
}
abi => self
.sess
.parse_sess
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/vtable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Codegen vtables and vtable accesses.
//!
//! See librustc_codegen_llvm/meth.rs for reference
//! See `rustc_codegen_ssa/src/meth.rs` for reference.
// FIXME dedup this logic between miri, cg_llvm and cg_clif

use crate::prelude::*;
Expand Down
44 changes: 28 additions & 16 deletions compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use rustc_middle::ty::query::Providers;
use rustc_middle::ty::{self, TyCtxt};
use rustc_session::config::OptLevel;
use rustc_session::Session;
use rustc_target::spec::abi::Abi;
use rustc_target::spec::{SanitizerSet, StackProbeType};

use crate::attributes;
Expand Down Expand Up @@ -293,7 +294,7 @@ pub fn from_fn_attrs(cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value, instance: ty::
// The target doesn't care; the subtarget reads our attribute.
apply_tune_cpu_attr(cx, llfn);

let function_features = codegen_fn_attrs
let mut function_features = codegen_fn_attrs
.target_features
.iter()
.map(|f| {
Expand All @@ -305,23 +306,10 @@ pub fn from_fn_attrs(cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value, instance: ty::
InstructionSetAttr::ArmT32 => "+thumb-mode".to_string(),
}))
.collect::<Vec<String>>();
if !function_features.is_empty() {
let mut global_features = llvm_util::llvm_global_features(cx.tcx.sess);
global_features.extend(function_features.into_iter());
let features = global_features.join(",");
let val = CString::new(features).unwrap();
llvm::AddFunctionAttrStringValue(
llfn,
llvm::AttributePlace::Function,
cstr!("target-features"),
&val,
);
}

// Note that currently the `wasm-import-module` doesn't do anything, but
// eventually LLVM 7 should read this and ferry the appropriate import
// module to the output file.
if cx.tcx.sess.target.is_like_wasm {
// If this function is an import from the environment but the wasm
// import has a specific module/name, apply them here.
if let Some(module) = wasm_import_module(cx.tcx, instance.def_id()) {
llvm::AddFunctionAttrStringValue(
llfn,
Expand All @@ -340,6 +328,30 @@ pub fn from_fn_attrs(cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value, instance: ty::
&name,
);
}

// The `"wasm"` abi on wasm targets automatically enables the
// `+multivalue` feature because the purpose of the wasm abi is to match
// the WebAssembly specification, which has this feature. This won't be
// needed when LLVM enables this `multivalue` feature by default.
if !cx.tcx.is_closure(instance.def_id()) {
let abi = cx.tcx.fn_sig(instance.def_id()).abi();
if abi == Abi::Wasm {
function_features.push("+multivalue".to_string());
}
}
}

if !function_features.is_empty() {
let mut global_features = llvm_util::llvm_global_features(cx.tcx.sess);
global_features.extend(function_features.into_iter());
let features = global_features.join(",");
let val = CString::new(features).unwrap();
llvm::AddFunctionAttrStringValue(
llfn,
llvm::AttributePlace::Function,
cstr!("target-features"),
&val,
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/svh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Svh {
impl Svh {
/// Creates a new `Svh` given the hash. If you actually want to
/// compute the SVH from some HIR, you want the `calculate_svh`
/// function found in `librustc_incremental`.
/// function found in `rustc_incremental`.
pub fn new(hash: u64) -> Svh {
Svh { hash }
}
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,9 @@ declare_features! (
/// Allows using `#[repr(align(...))]` on function items
(active, fn_align, "1.53.0", Some(82232), None),

/// Allows `extern "wasm" fn`
(active, wasm_abi, "1.53.0", Some(83788), None),

// -------------------------------------------------------------------------
// feature-group-end: actual feature gates
// -------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! # Feature gates
//!
//! This crate declares the set of past and present unstable features in the compiler.
//! Feature gate checking itself is done in `librustc_ast_passes/feature_gate.rs`
//! Feature gate checking itself is done in `rustc_ast_passes/src/feature_gate.rs`
//! at the moment.
//!
//! Features are enabled in programs via the crate-level attributes of
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/stable_hash_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_span::def_id::{DefPathHash, LocalDefId};

/// Requirements for a `StableHashingContext` to be used in this crate.
/// This is a hack to allow using the `HashStable_Generic` derive macro
/// instead of implementing everything in librustc_middle.
/// instead of implementing everything in `rustc_middle`.
pub trait HashStableContext:
rustc_ast::HashStableContext + rustc_target::HashStableContext
{
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir/src/weak_lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub static WEAK_ITEMS_REFS: SyncLazy<StableMap<Symbol, LangItem>> = SyncLazy::ne
map
});

/// The `check_name` argument avoids the need for `librustc_hir` to depend on
/// `librustc_session`.
/// The `check_name` argument avoids the need for `rustc_hir` to depend on
/// `rustc_session`.
pub fn link_name<'a, F>(check_name: F, attrs: &'a [ast::Attribute]) -> Option<Symbol>
where
F: Fn(&'a ast::Attribute, Symbol) -> bool
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! - **Type inference.** The type inference code can be found in the `infer` module;
//! this code handles low-level equality and subtyping operations. The
//! type check pass in the compiler is found in the `librustc_typeck` crate.
//! type check pass in the compiler is found in the `rustc_typeck` crate.
//!
//! For more information about how rustc works, see the [rustc dev guide].
//!
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_lexer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! Low-level Rust lexer.
//!
//! The idea with `librustc_lexer` is to make a reusable library,
//! The idea with `rustc_lexer` is to make a reusable library,
//! by separating out pure lexing and rustc-specific concerns, like spans,
//! error reporting, and interning. So, rustc_lexer operates directly on `&str`,
//! produces simple tokens which are a pair of type-tag and a bit of original text,
//! and does not report errors, instead storing them as flags on the token.
//!
//! Tokens produced by this lexer are not yet ready for parsing the Rust syntax.
//! For that see [`librustc_parse::lexer`], which converts this basic token stream
//! For that see [`rustc_parse::lexer`], which converts this basic token stream
//! into wide tokens used by actual parser.
//!
//! The purpose of this crate is to convert raw sources into a labeled sequence
Expand All @@ -17,7 +17,7 @@
//! The main entity of this crate is the [`TokenKind`] enum which represents common
//! lexeme types.
//!
//! [`librustc_parse::lexer`]: ../rustc_parse/lexer/index.html
//! [`rustc_parse::lexer`]: ../rustc_parse/lexer/index.html
// We want to be able to build this crate with a stable compiler, so no
// `#![feature]` attributes should be added.

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2280,7 +2280,7 @@ declare_lint! {
}

declare_lint_pass!(
/// Check for used feature gates in `INCOMPLETE_FEATURES` in `librustc_feature/active.rs`.
/// Check for used feature gates in `INCOMPLETE_FEATURES` in `rustc_feature/src/active.rs`.
IncompleteFeatures => [INCOMPLETE_FEATURES]
);

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ich/impls_syntax.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! This module contains `HashStable` implementations for various data types
//! from librustc_ast in no particular order.
//! from `rustc_ast` in no particular order.

use crate::ich::StableHashingContext;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static_assert_size!(InterpErrorInfo<'_>, 8);
/// Packages the kind of error we got from the const code interpreter
/// up with a Rust-level backtrace of where the error occurred.
/// Thsese should always be constructed by calling `.into()` on
/// a `InterpError`. In `librustc_mir::interpret`, we have `throw_err_*`
/// a `InterpError`. In `rustc_mir::interpret`, we have `throw_err_*`
/// macros for this.
#[derive(Debug)]
pub struct InterpErrorInfo<'tcx>(Box<InterpErrorInfoInner<'tcx>>);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/traits/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! which makes a canonical query by replacing unbound inference
//! variables and regions, so that results can be reused more broadly.
//! The providers for the queries defined here can be found in
//! `librustc_traits`.
//! `rustc_traits`.

use crate::ich::StableHashingContext;
use crate::infer::canonical::{Canonical, QueryResponse};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use std::ops::ControlFlow;
/// This trait is implemented for every type that can be folded.
/// Basically, every type that has a corresponding method in `TypeFolder`.
///
/// To implement this conveniently, use the derive macro located in librustc_macros.
/// To implement this conveniently, use the derive macro located in `rustc_macros`.
pub trait TypeFoldable<'tcx>: fmt::Debug + Clone {
fn super_fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self;
fn fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self {
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2630,6 +2630,7 @@ fn fn_can_unwind(
| AvrInterrupt
| AvrNonBlockingInterrupt
| CCmseNonSecureCall
| Wasm
| RustIntrinsic
| PlatformIntrinsic
| Unadjusted => false,
Expand Down Expand Up @@ -2712,6 +2713,7 @@ where
AmdGpuKernel => Conv::AmdGpuKernel,
AvrInterrupt => Conv::AvrInterrupt,
AvrNonBlockingInterrupt => Conv::AvrNonBlockingInterrupt,
Wasm => Conv::C,

// These API constants ought to be more specific...
Cdecl => Conv::C,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl BoundRegionKind {
/// Defines the kinds of types.
///
/// N.B., if you change this, you'll probably want to change the corresponding
/// AST structure in `librustc_ast/ast.rs` as well.
/// AST structure in `rustc_ast/src/ast.rs` as well.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, TyEncodable, TyDecodable, Debug)]
#[derive(HashStable)]
#[rustc_diagnostic_item = "TyKind"]
Expand Down Expand Up @@ -2116,7 +2116,7 @@ impl<'tcx> TyS<'tcx> {
///
/// Note that during type checking, we use an inference variable
/// to represent the closure kind, because it has not yet been
/// inferred. Once upvar inference (in `src/librustc_typeck/check/upvar.rs`)
/// inferred. Once upvar inference (in `rustc_typeck/src/check/upvar.rs`)
/// is complete, that type variable will be unified.
pub fn to_opt_closure_kind(&self) -> Option<ty::ClosureKind> {
match self.kind() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! This module provides linkage between RegionInferenceContext and
//! librustc_graphviz traits, specialized to attaching borrowck analysis
//! `rustc_graphviz` traits, specialized to attaching borrowck analysis
//! data to rendered labels.

use std::borrow::Cow;
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_mir_build/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ fn should_abort_on_panic(tcx: TyCtxt<'_>, fn_def_id: LocalDefId, abi: Abi) -> bo
| AvrInterrupt
| AvrNonBlockingInterrupt
| CCmseNonSecureCall
| Wasm
| RustIntrinsic
| PlatformIntrinsic
| Unadjusted => true,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl<'a> StringReader<'a> {
}

/// Turns simple `rustc_lexer::TokenKind` enum into a rich
/// `librustc_ast::TokenKind`. This turns strings into interned
/// `rustc_ast::TokenKind`. This turns strings into interned
/// symbols and runs additional validation.
fn cook_lexer_token(&self, token: rustc_lexer::TokenKind, start: BytePos) -> Option<TokenKind> {
Some(match token {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_query_system/src/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//! could not be instantiated because the current compilation session
//! contained no `DefId` for thing that had been removed.
//!
//! `DepNode` definition happens in `librustc_middle` with the `define_dep_nodes!()` macro.
//! `DepNode` definition happens in `rustc_middle` with the `define_dep_nodes!()` macro.
//! This macro defines the `DepKind` enum and a corresponding `DepConstructor` enum. The
//! `DepConstructor` enum links a `DepKind` to the parameters that are needed at runtime in order
//! to construct a valid `DepNode` fingerprint.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! Paths in macros, imports, expressions, types, patterns are resolved here.
//! Label and lifetime names are resolved here as well.
//!
//! Type-relative name resolution (methods, fields, associated items) happens in `librustc_typeck`.
//! Type-relative name resolution (methods, fields, associated items) happens in `rustc_typeck`.

#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(box_patterns)]
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ symbols! {
vreg,
vreg_low16,
warn,
wasm_abi,
wasm_import_module,
wasm_target_feature,
while_let,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`librustc_target` contains some very low-level details that are
`rustc_target` contains some very low-level details that are
specific to different compilation targets and so forth.

For more information about how rustc works, see the [rustc dev guide].
Expand Down
18 changes: 9 additions & 9 deletions compiler/rustc_target/src/abi/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ mod riscv;
mod s390x;
mod sparc;
mod sparc64;
mod wasm32;
mod wasm32_bindgen_compat;
mod wasm64;
mod wasm;
mod x86;
mod x86_64;
mod x86_win64;
Expand Down Expand Up @@ -648,12 +646,14 @@ impl<'a, Ty> FnAbi<'a, Ty> {
"nvptx64" => nvptx64::compute_abi_info(self),
"hexagon" => hexagon::compute_abi_info(self),
"riscv32" | "riscv64" => riscv::compute_abi_info(cx, self),
"wasm32" => match cx.target_spec().os.as_str() {
"emscripten" | "wasi" => wasm32::compute_abi_info(cx, self),
_ => wasm32_bindgen_compat::compute_abi_info(self),
},
"asmjs" => wasm32::compute_abi_info(cx, self),
"wasm64" => wasm64::compute_abi_info(cx, self),
"wasm32" | "wasm64" => {
if cx.target_spec().adjust_abi(abi) == spec::abi::Abi::Wasm {
wasm::compute_wasm_abi_info(self)
} else {
wasm::compute_c_abi_info(cx, self)
}
}
"asmjs" => wasm::compute_c_abi_info(cx, self),
a => return Err(format!("unrecognized arch \"{}\" in target specification", a)),
}

Expand Down
Loading