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 10 pull requests #108053

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9be0b3e
Fix `x fix` on the standard library itself
jyn514 Feb 3, 2023
0d6fdef
update ICU4X to 1.1.0
Feb 4, 2023
a06aaa4
Update the minimum external LLVM to 14
cuviper Feb 1, 2023
ffdbd58
Drop llvm14-builtins-abi with compiler_builtins 0.1.87
cuviper Feb 11, 2023
d6bc681
Store metrics from metrics.json into PGO CI timer
geordi Feb 6, 2023
afe9553
Log all metrics from `metrics.json`
Kobzol Feb 8, 2023
3504c40
Use is_str instead of string kind comparison
compiler-errors Feb 13, 2023
4285990
Add feature gate for non_lifetime_binders
compiler-errors Feb 4, 2023
43faa69
Rename some region-specific stuff
compiler-errors Feb 6, 2023
74a1eb5
Make things actually work
compiler-errors Dec 14, 2022
e2c7562
Be better about bound vars
compiler-errors Feb 6, 2023
bd3e324
A bit more work on late-bound consts
compiler-errors Feb 6, 2023
0162292
Deny some late-bound ty/ct in some positions, add tests
compiler-errors Feb 6, 2023
646e667
add a `#[rustc_coinductive]` attribute
lcnr Feb 14, 2023
51671cd
add test for coinduction in new solver
lcnr Feb 14, 2023
a2f0303
change the `marker` attribute to only_local
lcnr Feb 14, 2023
26e3363
Refactor refcounted structural_impls via functors
eggyal Feb 14, 2023
91d2516
interpret: rename Pointer::from_addr → from_addr_invalid
RalfJung Feb 14, 2023
3b510e8
Use derive attributes for uninteresting traversals
eggyal Feb 14, 2023
71bad87
Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjg…
matthiaskrgr Feb 14, 2023
6d78502
Rollup merge of #107573 - cuviper:drop-llvm-13, r=nagisa
matthiaskrgr Feb 14, 2023
42bd543
Rollup merge of #107626 - jyn514:x-fix, r=Mark-Simulacrum
matthiaskrgr Feb 14, 2023
0c5c12e
Rollup merge of #107673 - lukas-code:update-icu4x, r=davidtwco
matthiaskrgr Feb 14, 2023
557b6b1
Rollup merge of #107733 - Kobzol:opt-build-metrics, r=Mark-Simulacrum
matthiaskrgr Feb 14, 2023
5188391
Rollup merge of #108007 - compiler-errors:str-less-kind, r=Nilstrieb
matthiaskrgr Feb 14, 2023
6f22722
Rollup merge of #108033 - lcnr:coinductive-attr, r=compiler-errors
matthiaskrgr Feb 14, 2023
16b3055
Rollup merge of #108039 - eggyal:traverse_refcounts_via_functors, r=o…
matthiaskrgr Feb 14, 2023
5aaaac8
Rollup merge of #108040 - eggyal:attributes_for_uninteresting_travers…
matthiaskrgr Feb 14, 2023
ea31f83
Rollup merge of #108044 - RalfJung:from-addr-invalid, r=oli-obk
matthiaskrgr Feb 14, 2023
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
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
tidy: true
os: ubuntu-20.04-xl
env: {}
- name: x86_64-gnu-llvm-13
- name: x86_64-gnu-llvm-14
tidy: false
os: ubuntu-20.04-xl
env: {}
Expand Down Expand Up @@ -300,11 +300,7 @@ jobs:
env:
RUST_BACKTRACE: 1
os: ubuntu-20.04-xl
- name: x86_64-gnu-llvm-13
env:
RUST_BACKTRACE: 1
os: ubuntu-20.04-xl
- name: x86_64-gnu-llvm-13-stage1
- name: x86_64-gnu-llvm-14-stage1
env:
RUST_BACKTRACE: 1
os: ubuntu-20.04-xl
Expand Down
56 changes: 26 additions & 30 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,9 @@ dependencies = [

[[package]]
name = "compiler_builtins"
version = "0.1.85"
version = "0.1.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13e81c6cd7ab79f51a0c927d22858d61ad12bd0b3865f0b13ece02a4486aeabb"
checksum = "f867ce54c09855ccd135ad4a50c777182a0c7af5ff20a8f537617bd648b10d50"
dependencies = [
"cc",
"rustc-std-workspace-core",
Expand Down Expand Up @@ -2027,23 +2027,21 @@ checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a"

[[package]]
name = "icu_list"
version = "1.0.0"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c40218275f081c4493f190357c5395647b06734c2dc3dcb41cc099a0f60168b1"
checksum = "01a65ff0cab77c33c7e165c858eaa6e84a09f1e485dd495d9d0ae61083c6f786"
dependencies = [
"displaydoc",
"icu_locid",
"icu_provider",
"regex-automata 0.2.0",
"writeable",
"zerovec",
]

[[package]]
name = "icu_locid"
version = "1.0.0"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34b3de5d99a0e275fe6193b9586dbf37364daebc0d39c89b5cf8376a53b789e8"
checksum = "71d7a98ecb812760b5f077e55a4763edeefa7ccc30d6eb5680a70841ede81928"
dependencies = [
"displaydoc",
"litemap",
Expand All @@ -2054,9 +2052,9 @@ dependencies = [

[[package]]
name = "icu_provider"
version = "1.0.1"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f911086e3c521a8a824d4f8bfd87769645ced2f07ff913b521c0d793be07100"
checksum = "a86816c97bc4e613086497f9479f63e120315e056763e8c4435604f98d21d82d"
dependencies = [
"displaydoc",
"icu_locid",
Expand All @@ -2070,9 +2068,9 @@ dependencies = [

[[package]]
name = "icu_provider_adapters"
version = "1.0.0"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "980c71d8a91b246ebbb97847178a4b816eea39d1d550c70ee566384555bb6545"
checksum = "8e89bf33962b24bb48a4a21330c20c9ff17949338ea376360dd9eda2c209dca1"
dependencies = [
"icu_locid",
"icu_provider",
Expand All @@ -2083,9 +2081,9 @@ dependencies = [

[[package]]
name = "icu_provider_macros"
version = "1.0.0"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38cf6f5b65cf81f0b4298da647101acbfe6ae0e25263f92bd7a22597e9d6d606"
checksum = "9ddb07844c2ffc4c28840e799e9e54ff054393cf090740decf25624e9d94b93a"
dependencies = [
"proc-macro2",
"quote",
Expand Down Expand Up @@ -2451,9 +2449,9 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"

[[package]]
name = "litemap"
version = "0.6.0"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f34a3f4798fac63fb48cf277eefa38f94d3443baff555bb98e4f56bc9092368e"
checksum = "575d8a551c59104b4df91269921e5eab561aa1b77c618dac0414b5d44a4617de"

[[package]]
name = "lld-wrapper"
Expand Down Expand Up @@ -3756,7 +3754,6 @@ dependencies = [
"icu_locid",
"icu_provider",
"icu_provider_adapters",
"litemap",
"zerovec",
]

Expand Down Expand Up @@ -3998,7 +3995,6 @@ dependencies = [
"rustc_span",
"tracing",
"unic-langid",
"writeable",
]

[[package]]
Expand Down Expand Up @@ -5660,9 +5656,9 @@ dependencies = [

[[package]]
name = "tinystr"
version = "0.7.0"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8aeafdfd935e4a7fe16a91ab711fa52d54df84f9c8f7ca5837a9d1d902ef4c2"
checksum = "7ac3f5b6856e931e15e07b478e98c8045239829a65f9156d4fa7e7788197a5ef"
dependencies = [
"displaydoc",
"zerovec",
Expand Down Expand Up @@ -6352,9 +6348,9 @@ checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"

[[package]]
name = "writeable"
version = "0.5.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8e6ab4f5da1b24daf2c590cfac801bacb27b15b4f050e84eb60149ea726f06b"
checksum = "92d74a687e3b9a7a129db0a8c82b4d464eb9c36f5a66ca68572a7e5f1cfdb5bc"

[[package]]
name = "xattr"
Expand Down Expand Up @@ -6411,9 +6407,9 @@ dependencies = [

[[package]]
name = "yoke"
version = "0.6.2"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fe1d55ca72c32d573bfbd5cb2f0ca65a497854c44762957a6d3da96041a5184"
checksum = "222180af14a6b54ef2c33493c1eff77ae95a3687a21b243e752624006fb8f26e"
dependencies = [
"serde",
"stable_deref_trait",
Expand All @@ -6423,9 +6419,9 @@ dependencies = [

[[package]]
name = "yoke-derive"
version = "0.6.1"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1346e4cd025ae818b88566eac7eb65ab33a994ea55f355c86889af2e7e56b14e"
checksum = "ca800d73d6b7a7ee54f2608205c98b549fca71c9500c1abcb3abdc7708b4a8cb"
dependencies = [
"proc-macro2",
"quote",
Expand Down Expand Up @@ -6462,9 +6458,9 @@ checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f"

[[package]]
name = "zerovec"
version = "0.9.0"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d919a74c17749ccb17beaf6405562e413cd94e98ba52ca1e64bbe7eefbd8b8"
checksum = "154df60c74c4a844bc04a53cef4fc18a909d3ea07e19f5225eaba86209da3aa6"
dependencies = [
"yoke",
"zerofrom",
Expand All @@ -6473,9 +6469,9 @@ dependencies = [

[[package]]
name = "zerovec-derive"
version = "0.9.0"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "490e5f878c2856225e884c35927e7ea6db3c24cdb7229b72542c7526ad7ed49e"
checksum = "2154cb6e2a748163354165e22c6a555effb09ca2d16334767bf66bb404f2206e"
dependencies = [
"proc-macro2",
"quote",
Expand Down
34 changes: 0 additions & 34 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,27 +294,6 @@ impl<'a> AstValidator<'a> {
}
}

fn check_late_bound_lifetime_defs(&self, params: &[GenericParam]) {
// Check only lifetime parameters are present and that the lifetime
// parameters that are present have no bounds.
let non_lt_param_spans: Vec<_> = params
.iter()
.filter_map(|param| match param.kind {
GenericParamKind::Lifetime { .. } => {
if !param.bounds.is_empty() {
let spans: Vec<_> = param.bounds.iter().map(|b| b.span()).collect();
self.session.emit_err(ForbiddenLifetimeBound { spans });
}
None
}
_ => Some(param.ident.span),
})
.collect();
if !non_lt_param_spans.is_empty() {
self.session.emit_err(ForbiddenNonLifetimeParam { spans: non_lt_param_spans });
}
}

fn check_fn_decl(&self, fn_decl: &FnDecl, self_semantic: SelfSemantic) {
self.check_decl_num_args(fn_decl);
self.check_decl_cvaradic_pos(fn_decl);
Expand Down Expand Up @@ -745,7 +724,6 @@ impl<'a> AstValidator<'a> {
)
.emit();
});
self.check_late_bound_lifetime_defs(&bfty.generic_params);
if let Extern::Implicit(_) = bfty.ext {
let sig_span = self.session.source_map().next_point(ty.span.shrink_to_lo());
self.maybe_lint_missing_abi(sig_span, ty.id);
Expand Down Expand Up @@ -1318,9 +1296,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
for predicate in &generics.where_clause.predicates {
match predicate {
WherePredicate::BoundPredicate(bound_pred) => {
// A type binding, eg `for<'c> Foo: Send+Clone+'c`
self.check_late_bound_lifetime_defs(&bound_pred.bound_generic_params);

// This is slightly complicated. Our representation for poly-trait-refs contains a single
// binder and thus we only allow a single level of quantification. However,
// the syntax of Rust permits quantification in two places in where clauses,
Expand Down Expand Up @@ -1396,11 +1371,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
visit::walk_param_bound(self, bound)
}

fn visit_poly_trait_ref(&mut self, t: &'a PolyTraitRef) {
self.check_late_bound_lifetime_defs(&t.bound_generic_params);
visit::walk_poly_trait_ref(self, t);
}

fn visit_variant_data(&mut self, s: &'a VariantData) {
self.with_banned_assoc_ty_bound(|this| visit::walk_struct_def(this, s))
}
Expand Down Expand Up @@ -1437,10 +1407,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
.emit();
}

if let FnKind::Closure(ClosureBinder::For { generic_params, .. }, ..) = fk {
self.check_late_bound_lifetime_defs(generic_params);
}

if let FnKind::Fn(
_,
_,
Expand Down
55 changes: 54 additions & 1 deletion compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use rustc_span::symbol::sym;
use rustc_span::Span;
use rustc_target::spec::abi;

use crate::errors::ForbiddenLifetimeBound;

macro_rules! gate_feature_fn {
($visitor: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr, $help: expr) => {{
let (visitor, has_feature, span, name, explain, help) =
Expand Down Expand Up @@ -136,6 +138,34 @@ impl<'a> PostExpansionVisitor<'a> {
}
ImplTraitVisitor { vis: self }.visit_ty(ty);
}

fn check_late_bound_lifetime_defs(&self, params: &[ast::GenericParam]) {
// Check only lifetime parameters are present and that the lifetime
// parameters that are present have no bounds.
let non_lt_param_spans: Vec<_> = params
.iter()
.filter_map(|param| match param.kind {
ast::GenericParamKind::Lifetime { .. } => None,
_ => Some(param.ident.span),
})
.collect();
// FIXME: gate_feature_post doesn't really handle multispans...
if !non_lt_param_spans.is_empty() && !self.features.non_lifetime_binders {
feature_err(
&self.sess.parse_sess,
sym::non_lifetime_binders,
non_lt_param_spans,
rustc_errors::fluent::ast_passes_forbidden_non_lifetime_param,
)
.emit();
}
for param in params {
if !param.bounds.is_empty() {
let spans: Vec<_> = param.bounds.iter().map(|b| b.span()).collect();
self.sess.emit_err(ForbiddenLifetimeBound { spans });
}
}
}
}

impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
Expand All @@ -147,7 +177,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
..
}) = attr_info
{
gate_feature_fn!(self, has_feature, attr.span, *name, descr);
gate_feature_fn!(self, has_feature, attr.span, *name, *descr);
}
// Check unstable flavors of the `#[doc]` attribute.
if attr.has_name(sym::doc) {
Expand Down Expand Up @@ -306,6 +336,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
ast::TyKind::BareFn(bare_fn_ty) => {
// Function pointers cannot be `const`
self.check_extern(bare_fn_ty.ext, ast::Const::No);
self.check_late_bound_lifetime_defs(&bare_fn_ty.generic_params);
}
ast::TyKind::Never => {
gate_feature_post!(&self, never_type, ty.span, "the `!` type is experimental");
Expand All @@ -318,6 +349,19 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
visit::walk_ty(self, ty)
}

fn visit_generics(&mut self, g: &'a ast::Generics) {
for predicate in &g.where_clause.predicates {
match predicate {
ast::WherePredicate::BoundPredicate(bound_pred) => {
// A type binding, eg `for<'c> Foo: Send+Clone+'c`
self.check_late_bound_lifetime_defs(&bound_pred.bound_generic_params);
}
_ => {}
}
}
visit::walk_generics(self, g);
}

fn visit_fn_ret_ty(&mut self, ret_ty: &'a ast::FnRetTy) {
if let ast::FnRetTy::Ty(output_ty) = ret_ty {
if let ast::TyKind::Never = output_ty.kind {
Expand Down Expand Up @@ -437,12 +481,21 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
visit::walk_pat(self, pattern)
}

fn visit_poly_trait_ref(&mut self, t: &'a ast::PolyTraitRef) {
self.check_late_bound_lifetime_defs(&t.bound_generic_params);
visit::walk_poly_trait_ref(self, t);
}

fn visit_fn(&mut self, fn_kind: FnKind<'a>, span: Span, _: NodeId) {
if let Some(header) = fn_kind.header() {
// Stability of const fn methods are covered in `visit_assoc_item` below.
self.check_extern(header.ext, header.constness);
}

if let FnKind::Closure(ast::ClosureBinder::For { generic_params, .. }, ..) = fn_kind {
self.check_late_bound_lifetime_defs(generic_params);
}

if fn_kind.ctxt() != Some(FnCtxt::Foreign) && fn_kind.decl().c_variadic() {
gate_feature_post!(&self, c_variadic, span, "C-variadic functions are unstable");
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ pub fn eval_condition(
sess,
sym::cfg_target_compact,
cfg.span,
&"compact `cfg(target(..))` is experimental and subject to change"
"compact `cfg(target(..))` is experimental and subject to change"
).emit();
}

Expand Down
11 changes: 5 additions & 6 deletions compiler/rustc_baked_icu_data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ version = "0.0.0"
edition = "2021"

[dependencies]
icu_list = "1.0.0"
icu_locid = "1.0.0"
icu_provider = "1.0.1"
icu_provider_adapters = "1.0.0"
litemap = "0.6.0"
zerovec = "0.9.0"
icu_list = "1.1.0"
icu_locid = "1.1.0"
icu_provider = "1.1.0"
icu_provider_adapters = "1.1.0"
zerovec = "0.9.2"

[features]
rustc_use_parallel_compiler = ['icu_provider/sync']
Loading