Skip to content
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

Rollup of 11 pull requests #78792

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
7cae9e8
`#![deny(unsafe_op_in_unsafe_fn)]` in sys/hermit
maekawatoshiki Jul 31, 2020
3a46cca
Revert "`#![deny(unsafe_op_in_unsafe_fn)]` in sys/hermit"
maekawatoshiki Aug 21, 2020
d94258e
Add `#![allow(unsafe_op_in_unsafe_fn)]` in sys/hermit
maekawatoshiki Aug 21, 2020
14158f5
Remove #![allow(unsafe_op_in_unsafe_fn)] except for mod.rs
maekawatoshiki Oct 8, 2020
b3246e0
Set the proper sysroot for clippy
jyn514 Sep 29, 2020
51f8076
Add --fix support to `x.py clippy`
jyn514 Sep 30, 2020
bdbb542
x.py fmt
jyn514 Oct 10, 2020
31ecd2a
Allow using clippy with either beta or nightly
jyn514 Oct 10, 2020
e099138
BTreeMap: stop mistaking node for an orderly place
ssomers Oct 26, 2020
b0df3f7
fix some incorrect aliasing in the BTree
RalfJung Oct 28, 2020
1e73724
Allow using 1/2/3/4 for `x.py setup` options
jyn514 Oct 29, 2020
be01d54
BTreeMap: document a curious assumption in test cases
ssomers Oct 29, 2020
d2bc8a9
inliner: Use substs_for_mir_body
tmiasko Nov 3, 2020
2980367
Add new lint for automatic_links improvements
GuillaumeGomez Oct 12, 2020
a54f043
Add documentation for automatic_links lint
GuillaumeGomez Oct 12, 2020
6bc8965
Add tests for automatic_links lint
GuillaumeGomez Oct 12, 2020
f467b8d
Extend automatic_links lint to take into account URLs without link sy…
GuillaumeGomez Oct 13, 2020
7f839b2
Improve automatic_links globally
GuillaumeGomez Oct 14, 2020
55b4d21
Fix automatic_links warnings
GuillaumeGomez Oct 14, 2020
60caf51
Rename automatic_links to url_improvements
GuillaumeGomez Oct 17, 2020
fce2be0
Update URLs used in the lint example
GuillaumeGomez Oct 17, 2020
1fb404b
Don't check for URLs inside codeblocks
GuillaumeGomez Oct 17, 2020
6be97e2
Improve lint even more
GuillaumeGomez Oct 31, 2020
9d11450
Rename lint to non_autolinks
GuillaumeGomez Oct 31, 2020
16ed850
Fix more URLs
GuillaumeGomez Nov 5, 2020
54a0a98
ci: gate on aarch64-gnu passing tests
pietroalbini Oct 22, 2020
1274fae
doc/rustc: promote aarch64-unknown-linux-gnu to tier 1
pietroalbini Oct 22, 2020
874cbb8
ci: build docs for aarch64-unknown-linux-gnu
pietroalbini Oct 22, 2020
eed0ceb
Recognize `private_intra_doc_links` as a lint
jyn514 Oct 19, 2020
47b21b8
Add PRIVATE_INTRA_DOC_LINKS to rustdoc special-casing
jyn514 Nov 5, 2020
99200f7
Fix even more URLs
GuillaumeGomez Nov 5, 2020
3863dee
Infer the default host target from the host toolchain if possible
jyn514 Oct 29, 2020
8d2fa72
Get `--fix` working for everything except rustdoc
jyn514 Oct 27, 2020
4f4ce1c
Rollup merge of #74979 - maekawatoshiki:fix, r=Mark-Simulacrum
Dylan-DPC Nov 6, 2020
3124e79
Rollup merge of #77351 - jyn514:clippy-sysroot, r=Mark-Simulacrum
Dylan-DPC Nov 6, 2020
d6bd33d
Rollup merge of #77856 - GuillaumeGomez:automatic-links-lint, r=jyn51…
Dylan-DPC Nov 6, 2020
e422bef
Rollup merge of #78114 - jyn514:private, r=oli-obk
Dylan-DPC Nov 6, 2020
a8d4297
Rollup merge of #78228 - pietroalbini:finally, r=Mark-Simulacrum
Dylan-DPC Nov 6, 2020
d22cc21
Rollup merge of #78437 - ssomers:btree_no_ord_at_node_level, r=Mark-S…
Dylan-DPC Nov 6, 2020
e6f601e
Rollup merge of #78476 - RalfJung:btree-alias, r=Mark-Simulacrum
Dylan-DPC Nov 6, 2020
691cfad
Rollup merge of #78513 - jyn514:rustup-toolchain, r=Mark-Simulacrum
Dylan-DPC Nov 6, 2020
03eec1d
Rollup merge of #78514 - jyn514:setup-number, r=Mark-Simulacrum
Dylan-DPC Nov 6, 2020
f926cd3
Rollup merge of #78538 - ssomers:btree_testing_rng, r=Mark-Simulacrum
Dylan-DPC Nov 6, 2020
e71644d
Rollup merge of #78674 - tmiasko:inline-substs-for-mir-body, r=oli-obk
Dylan-DPC Nov 6, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 5 additions & 110 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ jobs:
strategy:
matrix:
include:
- name: aarch64-gnu
os:
- self-hosted
- ARM64
- linux
- name: arm-android
os: ubuntu-latest-xl
env: {}
Expand Down Expand Up @@ -509,116 +514,6 @@ jobs:
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
auto-fallible:
name: auto-fallible
env:
CI_JOB_NAME: "${{ matrix.name }}"
SCCACHE_BUCKET: rust-lang-gha-caches
DEPLOY_BUCKET: rust-lang-gha
TOOLSTATE_REPO: "https://github.com/pietroalbini/rust-toolstate"
TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/pietroalbini/rust-toolstate/issues"
TOOLSTATE_PUBLISH: 1
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
CACHE_DOMAIN: ci-caches-gha.rust-lang.org
if: "github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
strategy:
fail-fast: false
matrix:
include:
- name: aarch64-gnu
os:
- self-hosted
- ARM64
- linux
timeout-minutes: 600
runs-on: "${{ matrix.os }}"
steps:
- name: disable git crlf conversion
run: git config --global core.autocrlf false
- name: checkout the source code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: configure the PR in which the error message will be posted
run: "echo \"[CI_PR_NUMBER=$num]\""
env:
num: "${{ github.event.number }}"
if: "success() && !env.SKIP_JOBS && github.event_name == 'pull_request'"
- name: add extra environment variables
run: src/ci/scripts/setup-environment.sh
env:
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
if: success() && !env.SKIP_JOB
- name: decide whether to skip this job
run: src/ci/scripts/should-skip-this.sh
if: success() && !env.SKIP_JOB
- name: configure GitHub Actions to kill the build when outdated
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.github_token }}"
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
- name: collect CPU statistics
run: src/ci/scripts/collect-cpu-stats.sh
if: success() && !env.SKIP_JOB
- name: show the current environment
run: src/ci/scripts/dump-environment.sh
if: success() && !env.SKIP_JOB
- name: install awscli
run: src/ci/scripts/install-awscli.sh
if: success() && !env.SKIP_JOB
- name: install sccache
run: src/ci/scripts/install-sccache.sh
if: success() && !env.SKIP_JOB
- name: select Xcode
run: src/ci/scripts/select-xcode.sh
if: success() && !env.SKIP_JOB
- name: install clang
run: src/ci/scripts/install-clang.sh
if: success() && !env.SKIP_JOB
- name: install WIX
run: src/ci/scripts/install-wix.sh
if: success() && !env.SKIP_JOB
- name: ensure the build happens on a partition with enough space
run: src/ci/scripts/symlink-build-dir.sh
if: success() && !env.SKIP_JOB
- name: disable git crlf conversion
run: src/ci/scripts/disable-git-crlf-conversion.sh
if: success() && !env.SKIP_JOB
- name: install MSYS2
run: src/ci/scripts/install-msys2.sh
if: success() && !env.SKIP_JOB
- name: install MinGW
run: src/ci/scripts/install-mingw.sh
if: success() && !env.SKIP_JOB
- name: install ninja
run: src/ci/scripts/install-ninja.sh
if: success() && !env.SKIP_JOB
- name: enable ipv6 on Docker
run: src/ci/scripts/enable-docker-ipv6.sh
if: success() && !env.SKIP_JOB
- name: disable git crlf conversion
run: src/ci/scripts/disable-git-crlf-conversion.sh
if: success() && !env.SKIP_JOB
- name: checkout submodules
run: src/ci/scripts/checkout-submodules.sh
if: success() && !env.SKIP_JOB
- name: ensure line endings are correct
run: src/ci/scripts/verify-line-endings.sh
if: success() && !env.SKIP_JOB
- name: run the build
run: src/ci/scripts/run-build-from-ci.sh
env:
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
if: success() && !env.SKIP_JOB
- name: upload artifacts to S3
run: src/ci/scripts/upload-artifacts.sh
env:
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
try:
name: try
env:
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4297,6 +4297,7 @@ dependencies = [
"itertools 0.9.0",
"minifier",
"pulldown-cmark 0.8.0",
"regex",
"rustc-rayon",
"serde",
"serde_json",
Expand Down
12 changes: 5 additions & 7 deletions compiler/rustc_codegen_cranelift/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,11 @@ impl<'tcx, M: Module> FunctionCx<'_, 'tcx, M> {
where
T: TypeFoldable<'tcx> + Copy,
{
if let Some(substs) = self.instance.substs_for_mir_body() {
self.tcx
.subst_and_normalize_erasing_regions(substs, ty::ParamEnv::reveal_all(), value)
} else {
self.tcx
.normalize_erasing_regions(ty::ParamEnv::reveal_all(), *value)
}
self.instance.subst_mir_and_normalize_erasing_regions(
self.tcx,
ty::ParamEnv::reveal_all(),
value
)
}

pub(crate) fn clif_type(&self, ty: Ty<'tcx>) -> Option<Type> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/discriminant.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Handling of enum discriminants
//!
//! Adapted from https://github.com/rust-lang/rust/blob/d760df5aea483aae041c9a241e7acacf48f75035/src/librustc_codegen_ssa/mir/place.rs
//! Adapted from <https://github.com/rust-lang/rust/blob/d760df5aea483aae041c9a241e7acacf48f75035/src/librustc_codegen_ssa/mir/place.rs>

use rustc_target::abi::{Int, TagEncoding, Variants};

Expand Down
14 changes: 5 additions & 9 deletions compiler/rustc_codegen_ssa/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
T: Copy + TypeFoldable<'tcx>,
{
debug!("monomorphize: self.instance={:?}", self.instance);
if let Some(substs) = self.instance.substs_for_mir_body() {
self.cx.tcx().subst_and_normalize_erasing_regions(
substs,
ty::ParamEnv::reveal_all(),
&value,
)
} else {
self.cx.tcx().normalize_erasing_regions(ty::ParamEnv::reveal_all(), *value)
}
self.instance.subst_mir_and_normalize_erasing_regions(
self.cx.tcx(),
ty::ParamEnv::reveal_all(),
value,
)
}
}

Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_lint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ use rustc_middle::ty::TyCtxt;
use rustc_session::lint::builtin::{
BARE_TRAIT_OBJECTS, BROKEN_INTRA_DOC_LINKS, ELIDED_LIFETIMES_IN_PATHS,
EXPLICIT_OUTLIVES_REQUIREMENTS, INVALID_CODEBLOCK_ATTRIBUTES, INVALID_HTML_TAGS,
MISSING_DOC_CODE_EXAMPLES, PRIVATE_DOC_TESTS,
MISSING_DOC_CODE_EXAMPLES, NON_AUTOLINKS, PRIVATE_DOC_TESTS,
};
use rustc_span::symbol::{Ident, Symbol};
use rustc_span::Span;
Expand Down Expand Up @@ -313,6 +313,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) {

add_lint_group!(
"rustdoc",
NON_AUTOLINKS,
BROKEN_INTRA_DOC_LINKS,
PRIVATE_INTRA_DOC_LINKS,
INVALID_CODEBLOCK_ATTRIBUTES,
Expand Down
13 changes: 13 additions & 0 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,17 @@ declare_lint! {
"detects invalid HTML tags in doc comments"
}

declare_lint! {
/// The `non_autolinks` lint detects when a URL could be written using
/// only angle brackets. This is a `rustdoc` only lint, see the
/// documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#non_autolinks
pub NON_AUTOLINKS,
Warn,
"detects URLs that could be written using only angle brackets"
}

declare_lint! {
/// The `where_clauses_object_safety` lint detects for [object safety] of
/// [where clauses].
Expand Down Expand Up @@ -2790,11 +2801,13 @@ declare_lint_pass! {
UNSTABLE_NAME_COLLISIONS,
IRREFUTABLE_LET_PATTERNS,
BROKEN_INTRA_DOC_LINKS,
PRIVATE_INTRA_DOC_LINKS,
INVALID_CODEBLOCK_ATTRIBUTES,
MISSING_CRATE_LEVEL_DOCS,
MISSING_DOC_CODE_EXAMPLES,
INVALID_HTML_TAGS,
PRIVATE_DOC_TESTS,
NON_AUTOLINKS,
WHERE_CLAUSES_OBJECT_SAFETY,
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
MACRO_USE_EXTERN_CRATE,
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_lint_defs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ pub struct Lint {
/// The name is written with underscores, e.g., "unused_imports".
/// On the command line, underscores become dashes.
///
/// See https://rustc-dev-guide.rust-lang.org/diagnostics.html#lint-naming
/// See <https://rustc-dev-guide.rust-lang.org/diagnostics.html#lint-naming>
/// for naming guidelines.
pub name: &'static str,

/// Default level for the lint.
///
/// See https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-levels
/// See <https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-levels>
/// for guidelines on choosing a default level.
pub default_level: Level,

Expand Down Expand Up @@ -330,8 +330,8 @@ impl LintBuffer {

/// Declares a static item of type `&'static Lint`.
///
/// See https://rustc-dev-guide.rust-lang.org/diagnostics.html for documentation
/// and guidelines on writing lints.
/// See <https://rustc-dev-guide.rust-lang.org/diagnostics.html> for
/// documentation and guidelines on writing lints.
///
/// The macro call should start with a doc comment explaining the lint
/// which will be embedded in the rustc user documentation book. It should
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/mir/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ rustc_index::newtype_index! {
impl ExpressionOperandId {
/// An expression operand for a "zero counter", as described in the following references:
///
/// * https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#counter
/// * https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#tag
/// * https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#counter-expressions
/// * <https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#counter>
/// * <https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#tag>
/// * <https://github.com/rust-lang/llvm-project/blob/llvmorg-8.0.0/llvm/docs/CoverageMappingFormat.rst#counter-expressions>
///
/// This operand can be used to count two or more separate code regions with a single counter,
/// if they run sequentially with no branches, by injecting the `Counter` in a `BasicBlock` for
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub struct CodegenUnit<'tcx> {

/// Specifies the linkage type for a `MonoItem`.
///
/// See https://llvm.org/docs/LangRef.html#linkage-types for more details about these variants.
/// See <https://llvm.org/docs/LangRef.html#linkage-types> for more details about these variants.
#[derive(Copy, Clone, PartialEq, Debug, TyEncodable, TyDecodable, HashStable)]
pub enum Linkage {
External,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ pub struct TypeckResults<'tcx> {
/// leads to a `vec![&&Option<i32>, &Option<i32>]`. Empty vectors are not stored.
///
/// See:
/// https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#definitions
/// <https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#definitions>
pat_adjustments: ItemLocalMap<Vec<Ty<'tcx>>>,

/// Borrows
Expand Down
27 changes: 25 additions & 2 deletions compiler/rustc_middle/src/ty/instance.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use crate::ty::print::{FmtPrinter, Printer};
use crate::ty::subst::InternalSubsts;
use crate::ty::subst::{InternalSubsts, Subst};
use crate::ty::{self, SubstsRef, Ty, TyCtxt, TypeFoldable};
use rustc_errors::ErrorReported;
use rustc_hir::def::Namespace;
Expand Down Expand Up @@ -470,10 +470,33 @@ impl<'tcx> Instance<'tcx> {
/// This function returns `Some(substs)` in the former case and `None` otherwise -- i.e., if
/// this function returns `None`, then the MIR body does not require substitution during
/// codegen.
pub fn substs_for_mir_body(&self) -> Option<SubstsRef<'tcx>> {
fn substs_for_mir_body(&self) -> Option<SubstsRef<'tcx>> {
if self.def.has_polymorphic_mir_body() { Some(self.substs) } else { None }
}

pub fn subst_mir<T>(&self, tcx: TyCtxt<'tcx>, v: &T) -> T
where
T: TypeFoldable<'tcx> + Copy,
{
if let Some(substs) = self.substs_for_mir_body() { v.subst(tcx, substs) } else { *v }
}

pub fn subst_mir_and_normalize_erasing_regions<T>(
&self,
tcx: TyCtxt<'tcx>,
param_env: ty::ParamEnv<'tcx>,
v: &T,
) -> T
where
T: TypeFoldable<'tcx> + Clone,
{
if let Some(substs) = self.substs_for_mir_body() {
tcx.subst_and_normalize_erasing_regions(substs, param_env, v)
} else {
tcx.normalize_erasing_regions(param_env, v.clone())
}
}

/// Returns a new `Instance` where generic parameters in `instance.substs` are replaced by
/// identify parameters if they are determined to be unused in `instance.def`.
pub fn polymorphize(self, tcx: TyCtxt<'tcx>) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/borrow_check/region_infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
/// terms that the "longer free region" `'a` outlived the "shorter free region" `'b`.
///
/// More details can be found in this blog post by Niko:
/// http://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/
/// <http://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/>
///
/// In the canonical example
///
Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_mir/src/interpret/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
frame: &Frame<'mir, 'tcx, M::PointerTag, M::FrameExtra>,
value: T,
) -> T {
if let Some(substs) = frame.instance.substs_for_mir_body() {
self.tcx.subst_and_normalize_erasing_regions(substs, self.param_env, &value)
} else {
self.tcx.normalize_erasing_regions(self.param_env, value)
}
frame.instance.subst_mir_and_normalize_erasing_regions(*self.tcx, self.param_env, &value)
}

/// The `substs` are assumed to already be in our interpreter "universe" (param_env).
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_mir/src/monomorphize/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,11 @@ impl<'a, 'tcx> MirNeighborCollector<'a, 'tcx> {
T: TypeFoldable<'tcx>,
{
debug!("monomorphize: self.instance={:?}", self.instance);
if let Some(substs) = self.instance.substs_for_mir_body() {
self.tcx.subst_and_normalize_erasing_regions(substs, ty::ParamEnv::reveal_all(), &value)
} else {
self.tcx.normalize_erasing_regions(ty::ParamEnv::reveal_all(), value)
}
self.instance.subst_mir_and_normalize_erasing_regions(
self.tcx,
ty::ParamEnv::reveal_all(),
&value,
)
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/transform/dest_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! inside a single block to shuffle a value around unnecessarily.
//!
//! LLVM by itself is not good enough at eliminating these redundant copies (eg. see
//! https://github.com/rust-lang/rust/issues/32966), so this leaves some performance on the table
//! <https://github.com/rust-lang/rust/issues/32966>), so this leaves some performance on the table
//! that we can regain by implementing an optimization for removing these assign statements in rustc
//! itself. When this optimization runs fast enough, it can also speed up the constant evaluation
//! and code generation phases of rustc due to the reduced number of statements and locals.
Expand Down
Loading