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 8 pull requests #81620

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
496836a
Improve `rustc_mir_build::matches` docs
camelid Jan 25, 2021
8afe598
Add big-endian support for AArch64 va_arg
Jan 20, 2021
d53b0a0
Fix ARM and AArch64 calling convention for passing small composite types
Jan 20, 2021
06f14df
Support AArch64 ILP32 in libunwind bindings
Jan 20, 2021
a112c4d
Support AArch64 big-endian and ILP32 in compiletest
Jan 20, 2021
8783d1a
Add big-endian and ILP32 AArch64 targets
Jan 20, 2021
69e6326
Add new aarch64 targets to platform-support.md
Jan 26, 2021
5307230
Bump LLVM submodule
Jan 21, 2021
fc156a3
Upgrade libc to 0.2.83
Jan 21, 2021
f8e0e78
Rename NLL* to Nll* accordingly to C-CASE
hkmatsumoto Jan 28, 2021
d10ee0d
Fix invalid camel case suggestion involving unicode idents
estebank Jan 29, 2021
fa9a99f
review comments
estebank Jan 31, 2021
0a93cb3
Remove unneeded explicit width from search results
GuillaumeGomez Jan 31, 2021
07f5ca7
Prevent search section to go over search input
GuillaumeGomez Jan 31, 2021
be9b112
Improve resize handling
GuillaumeGomez Jan 31, 2021
3acd1a4
Fix calling convention for CRT startup
Jan 31, 2021
6a03f03
Add error message for private fn
JulianKnodt Nov 22, 2020
2bb4a69
Move some tests to more reasonable directories
c410-f3r Jan 31, 2021
8b52cdc
Update outdated comment
camelid Jan 31, 2021
c96d888
Rollup merge of #79291 - JulianKnodt:ce_priv, r=petrochenkov
JohnTitor Feb 1, 2021
0be141c
Rollup merge of #81364 - camelid:improve-build-matches-docs, r=varkor
JohnTitor Feb 1, 2021
69f0364
Rollup merge of #81387 - c410-f3r:tests-tests-tests, r=petrochenkov
JohnTitor Feb 1, 2021
ce3f1ce
Rollup merge of #81455 - Amanieu:aarch64_ilp32, r=varkor
JohnTitor Feb 1, 2021
4d5f089
Rollup merge of #81463 - matsujika:nll-ensure-c-case, r=varkor
JohnTitor Feb 1, 2021
c4c2ab6
Rollup merge of #81529 - estebank:case_lints, r=davidtwco
JohnTitor Feb 1, 2021
05ec03c
Rollup merge of #81592 - GuillaumeGomez:rustdoc-ui-fixes, r=Nemo157
JohnTitor Feb 1, 2021
29fe200
Rollup merge of #81598 - sivadeilra:windows_dll_imports_fix_x86, r=m-…
JohnTitor Feb 1, 2021
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
5 changes: 3 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1783,9 +1783,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"

[[package]]
name = "libc"
version = "0.2.79"
version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743"
checksum = "7eb0c4e9c72ee9d69b767adebc5f4788462a3b45624acd919475c92597bcaf4f"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down Expand Up @@ -4133,6 +4133,7 @@ dependencies = [
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_trait_selection",
"rustc_typeck",
"tracing",
]
Expand Down
12 changes: 8 additions & 4 deletions compiler/rustc_codegen_llvm/src/va_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ fn emit_aapcs_va_arg(
let mut end = bx.build_sibling_block("va_arg.end");
let zero = bx.const_i32(0);
let offset_align = Align::from_bytes(4).unwrap();
assert_eq!(bx.tcx().sess.target.endian, Endian::Little);

let gr_type = target_ty.is_any_ptr() || target_ty.is_integral();
let (reg_off, reg_top_index, slot_size) = if gr_type {
Expand Down Expand Up @@ -144,9 +143,14 @@ fn emit_aapcs_va_arg(
let top = in_reg.load(top, bx.tcx().data_layout.pointer_align.abi);

// reg_value = *(@top + reg_off_v);
let top = in_reg.gep(top, &[reg_off_v]);
let top = in_reg.bitcast(top, bx.cx.type_ptr_to(layout.llvm_type(bx)));
let reg_value = in_reg.load(top, layout.align.abi);
let mut reg_addr = in_reg.gep(top, &[reg_off_v]);
if bx.tcx().sess.target.endian == Endian::Big && layout.size.bytes() != slot_size {
// On big-endian systems the value is right-aligned in its slot.
let offset = bx.const_i32((slot_size - layout.size.bytes()) as i32);
reg_addr = in_reg.gep(reg_addr, &[offset]);
}
let reg_addr = in_reg.bitcast(reg_addr, bx.cx.type_ptr_to(layout.llvm_type(bx)));
let reg_value = in_reg.load(reg_addr, layout.align.abi);
in_reg.br(&end.llbb());

// On Stack block
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_infer/src/infer/canonical/query_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::infer::canonical::{
};
use crate::infer::nll_relate::{NormalizationStrategy, TypeRelating, TypeRelatingDelegate};
use crate::infer::region_constraints::{Constraint, RegionConstraintData};
use crate::infer::{InferCtxt, InferOk, InferResult, NLLRegionVariableOrigin};
use crate::infer::{InferCtxt, InferOk, InferResult, NllRegionVariableOrigin};
use crate::traits::query::{Fallible, NoSolution};
use crate::traits::TraitEngine;
use crate::traits::{Obligation, ObligationCause, PredicateObligation};
Expand Down Expand Up @@ -644,7 +644,7 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
}

fn next_existential_region_var(&mut self, from_forall: bool) -> ty::Region<'tcx> {
let origin = NLLRegionVariableOrigin::Existential { from_forall };
let origin = NllRegionVariableOrigin::Existential { from_forall };
self.infcx.next_nll_region_var(origin)
}

Expand All @@ -654,7 +654,7 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {

fn generalize_existential(&mut self, universe: ty::UniverseIndex) -> ty::Region<'tcx> {
self.infcx.next_nll_region_var_in_universe(
NLLRegionVariableOrigin::Existential { from_forall: false },
NllRegionVariableOrigin::Existential { from_forall: false },
universe,
)
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
let var_name = self.tcx.hir().name(upvar_id.var_path.hir_id);
format!(" for capture of `{}` by closure", var_name)
}
infer::NLL(..) => bug!("NLL variable found in lexical phase"),
infer::Nll(..) => bug!("NLL variable found in lexical phase"),
};

struct_span_err!(
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,11 @@ pub enum RegionVariableOrigin {

/// This origin is used for the inference variables that we create
/// during NLL region processing.
NLL(NLLRegionVariableOrigin),
Nll(NllRegionVariableOrigin),
}

#[derive(Copy, Clone, Debug)]
pub enum NLLRegionVariableOrigin {
pub enum NllRegionVariableOrigin {
/// During NLL region processing, we create variables for free
/// regions that we encounter in the function signature and
/// elsewhere. This origin indices we've got one of those.
Expand Down Expand Up @@ -1078,17 +1078,17 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}

/// Just a convenient wrapper of `next_region_var` for using during NLL.
pub fn next_nll_region_var(&self, origin: NLLRegionVariableOrigin) -> ty::Region<'tcx> {
self.next_region_var(RegionVariableOrigin::NLL(origin))
pub fn next_nll_region_var(&self, origin: NllRegionVariableOrigin) -> ty::Region<'tcx> {
self.next_region_var(RegionVariableOrigin::Nll(origin))
}

/// Just a convenient wrapper of `next_region_var` for using during NLL.
pub fn next_nll_region_var_in_universe(
&self,
origin: NLLRegionVariableOrigin,
origin: NllRegionVariableOrigin,
universe: ty::UniverseIndex,
) -> ty::Region<'tcx> {
self.next_region_var_in_universe(RegionVariableOrigin::NLL(origin), universe)
self.next_region_var_in_universe(RegionVariableOrigin::Nll(origin), universe)
}

pub fn var_for_def(&self, span: Span, param: &ty::GenericParamDef) -> GenericArg<'tcx> {
Expand Down Expand Up @@ -1770,7 +1770,7 @@ impl RegionVariableOrigin {
| LateBoundRegion(a, ..)
| UpvarRegion(_, a) => a,
BoundRegionInCoherence(_) => rustc_span::DUMMY_SP,
NLL(..) => bug!("NLL variable used with `span`"),
Nll(..) => bug!("NLL variable used with `span`"),
}
}
}
Expand Down
19 changes: 18 additions & 1 deletion compiler/rustc_lint/src/nonstandard_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,19 @@ declare_lint! {

declare_lint_pass!(NonCamelCaseTypes => [NON_CAMEL_CASE_TYPES]);

/// Some unicode characters *have* case, are considered upper case or lower case, but they *can't*
/// be upper cased or lower cased. For the purposes of the lint suggestion, we care about being able
/// to change the char's case.
fn char_has_case(c: char) -> bool {
c.is_lowercase() || c.is_uppercase()
let mut l = c.to_lowercase();
let mut u = c.to_uppercase();
while let Some(l) = l.next() {
match u.next() {
Some(u) if l != u => return true,
_ => {}
}
}
u.next().is_some()
}

fn is_camel_case(name: &str) -> bool {
Expand Down Expand Up @@ -138,6 +149,8 @@ impl NonCamelCaseTypes {
to_camel_case(name),
Applicability::MaybeIncorrect,
);
} else {
err.span_label(ident.span, "should have an UpperCamelCase name");
}

err.emit();
Expand Down Expand Up @@ -299,6 +312,8 @@ impl NonSnakeCase {
} else {
err.help(&format!("convert the identifier to snake case: `{}`", sc));
}
} else {
err.span_label(ident.span, "should have a snake_case name");
}

err.emit();
Expand Down Expand Up @@ -477,6 +492,8 @@ impl NonUpperCaseGlobals {
uc,
Applicability::MaybeIncorrect,
);
} else {
err.span_label(ident.span, "should have an UPPER_CASE name");
}

err.emit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::collections::VecDeque;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_index::vec::IndexVec;
use rustc_infer::infer::NLLRegionVariableOrigin;
use rustc_infer::infer::NllRegionVariableOrigin;
use rustc_middle::mir::{
Body, CastKind, ConstraintCategory, FakeReadCause, Local, Location, Operand, Place, Rvalue,
Statement, StatementKind, TerminatorKind,
Expand Down Expand Up @@ -258,7 +258,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
let (category, from_closure, span) = self.regioncx.best_blame_constraint(
&self.body,
borrow_region,
NLLRegionVariableOrigin::FreeRegion,
NllRegionVariableOrigin::FreeRegion,
|r| self.regioncx.provides_universal_region(r, borrow_region, outlived_region),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_infer::infer::{
error_reporting::nice_region_error::NiceRegionError,
error_reporting::unexpected_hidden_region_diagnostic, NLLRegionVariableOrigin,
error_reporting::unexpected_hidden_region_diagnostic, NllRegionVariableOrigin,
};
use rustc_middle::mir::{ConstraintCategory, ReturnConstraint};
use rustc_middle::ty::subst::Subst;
Expand Down Expand Up @@ -75,13 +75,13 @@ crate enum RegionErrorKind<'tcx> {
/// The region element that erroneously must be outlived by `longer_fr`.
error_element: RegionElement,
/// The origin of the placeholder region.
fr_origin: NLLRegionVariableOrigin,
fr_origin: NllRegionVariableOrigin,
},

/// Any other lifetime error.
RegionError {
/// The origin of the region.
fr_origin: NLLRegionVariableOrigin,
fr_origin: NllRegionVariableOrigin,
/// The region that should outlive `shorter_fr`.
longer_fr: RegionVid,
/// The region that should be shorter, but we can't prove it.
Expand Down Expand Up @@ -269,7 +269,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
pub(in crate::borrow_check) fn report_region_error(
&mut self,
fr: RegionVid,
fr_origin: NLLRegionVariableOrigin,
fr_origin: NllRegionVariableOrigin,
outlived_fr: RegionVid,
outlives_suggestion: &mut OutlivesSuggestionBuilder,
) {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir/src/borrow_check/region_infer/dump_mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use super::{OutlivesConstraint, RegionInferenceContext};
use crate::borrow_check::type_check::Locations;
use rustc_infer::infer::NLLRegionVariableOrigin;
use rustc_infer::infer::NllRegionVariableOrigin;
use rustc_middle::ty::TyCtxt;
use std::io::{self, Write};

Expand All @@ -20,7 +20,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
writeln!(out, "| Free Region Mapping")?;

for region in self.regions() {
if let NLLRegionVariableOrigin::FreeRegion = self.definitions[region].origin {
if let NllRegionVariableOrigin::FreeRegion = self.definitions[region].origin {
let classification = self.universal_regions.region_classification(region).unwrap();
let outlived_by = self.universal_region_relations.regions_outlived_by(region);
writeln!(
Expand Down
Loading