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 12 pull requests #117404

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
351d532
interpret: call caller_location logic the same way codegen does, and …
RalfJung Oct 28, 2023
04fa124
share the track_caller handling within a mir::Body
RalfJung Oct 28, 2023
552abdc
Rename a few remaining references to abort terminator
tmiasko Oct 29, 2023
82b447a
Add support for mipsel-unknown-netbsd, 32-bit LE mips.
he32 Oct 29, 2023
5e6c313
mipsel_unknown_netbsd.rs: fix indentation.
he32 Oct 29, 2023
28e60de
Remove `memoffset` dependency from `rustc_query_impl`.
nnethercote Oct 23, 2023
8ff624a
Clean up `rustc_*/Cargo.toml`.
nnethercote Oct 20, 2023
8c04999
On object safety error, mention new enum as alternative
estebank Oct 24, 2023
678e01a
Delay parsing of `--cfg` and `--check-cfg` options.
nnethercote Oct 30, 2023
bfcff79
Reduce exposure of cfg parsers.
nnethercote Oct 30, 2023
8e4ac98
Change cfg parsers to produce symbols instead of strings.
nnethercote Oct 30, 2023
5c6a12c
Make `Cfg` and `CheckCfg` non-generic.
nnethercote Oct 30, 2023
371f972
Improve readability of `parse_check_cfg`.
nnethercote Oct 30, 2023
85e56e8
Remove out-of-date comment.
nnethercote Oct 30, 2023
a60d643
Wrap some overlong comments.
nnethercote Oct 30, 2023
95b0088
Remove `check_output`.
nnethercote Oct 30, 2023
4b14048
improve and fix x install
onur-ozkan Oct 30, 2023
be8fd8b
Streamline `collect_crate_types`.
nnethercote Oct 30, 2023
90862f6
Remove an unnecessary `drop`.
nnethercote Oct 30, 2023
0c381ec
Streamline some `use` items.
nnethercote Oct 30, 2023
745c600
Talk about `gen fn` in diagnostics about `gen fn`
oli-obk Oct 30, 2023
bc926f7
Add a custom panic message for resuming `gen` blocks after they panicked
oli-obk Oct 30, 2023
a2486db
Fix missing leading space in suggestion
gurry Oct 30, 2023
82f34fd
Fix #117284, Fix unused variables lint issue for args in macro
chenyukang Oct 30, 2023
8508e65
Fix bad-c-variadic error being emitted multiple times
nicholasbishop Oct 29, 2023
f91b5ce
Explicitly reject const C-variadic functions
nicholasbishop Oct 29, 2023
58a80c8
rustdoc: elide cross-crate default generic arguments
fmease Jun 9, 2023
ac9c5bd
Only run panic tests on targets that can unwind
oli-obk Oct 30, 2023
adce189
Rollup merge of #112463 - fmease:rustdoc-elide-x-crate-def-gen-args, …
GuillaumeGomez Oct 30, 2023
e37cabe
Rollup merge of #117068 - nnethercote:clean-up-Cargo-toml, r=wesleywiser
GuillaumeGomez Oct 30, 2023
c7e6301
Rollup merge of #117132 - estebank:issue-80194, r=petrochenkov
GuillaumeGomez Oct 30, 2023
ead3561
Rollup merge of #117317 - RalfJung:track-caller, r=oli-obk
GuillaumeGomez Oct 30, 2023
7d129fd
Rollup merge of #117356 - he32:netbsd-mipsel, r=oli-obk
GuillaumeGomez Oct 30, 2023
adc6f2e
Rollup merge of #117357 - tmiasko:terminate, r=wesleywiser
GuillaumeGomez Oct 30, 2023
52a5271
Rollup merge of #117370 - nicholasbishop:bishop-better-c-variadic-err…
GuillaumeGomez Oct 30, 2023
4c84a8a
Rollup merge of #117376 - nnethercote:rustc_interface-more, r=oli-obk
GuillaumeGomez Oct 30, 2023
5d6645d
Rollup merge of #117383 - onur-ozkan:fix-x-install, r=albertlarsan68
GuillaumeGomez Oct 30, 2023
284e95f
Rollup merge of #117389 - oli-obk:gen_fn, r=compiler-errors
GuillaumeGomez Oct 30, 2023
a4df941
Rollup merge of #117390 - chenyukang:yukang-fix-117284-unused-macro, …
GuillaumeGomez Oct 30, 2023
bf6f582
Rollup merge of #117395 - gurry:117380-wrong-parent-sugg, r=Nilstrieb
GuillaumeGomez Oct 30, 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
1 change: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4412,7 +4412,6 @@ version = "0.0.0"
dependencies = [
"field-offset",
"measureme",
"memoffset",
"rustc-rayon-core",
"rustc_data_structures",
"rustc_errors",
Expand Down
13 changes: 10 additions & 3 deletions compiler/rustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,31 @@ version = "0.0.0"
edition = "2021"

[dependencies]
rustc_driver = { path = "../rustc_driver" }
rustc_driver_impl = { path = "../rustc_driver_impl" }
# tidy-alphabetical-start

# Make sure rustc_codegen_ssa ends up in the sysroot, because this
# crate is intended to be used by codegen backends, which may not be in-tree.
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }

rustc_driver = { path = "../rustc_driver" }
rustc_driver_impl = { path = "../rustc_driver_impl" }

# Make sure rustc_smir ends up in the sysroot, because this
# crate is intended to be used by stable MIR consumers, which are not in-tree
# crate is intended to be used by stable MIR consumers, which are not in-tree.
rustc_smir = { path = "../rustc_smir" }

stable_mir = { path = "../stable_mir" }
# tidy-alphabetical-end

[dependencies.jemalloc-sys]
version = "0.5.0"
optional = true
features = ['unprefixed_malloc_on_supported_platforms']

[features]
# tidy-alphabetical-start
jemalloc = ['jemalloc-sys']
llvm = ['rustc_driver_impl/llvm']
max_level_info = ['rustc_driver_impl/max_level_info']
rustc_use_parallel_compiler = ['rustc_driver_impl/rustc_use_parallel_compiler']
# tidy-alphabetical-end
8 changes: 6 additions & 2 deletions compiler/rustc_abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ version = "0.0.0"
edition = "2021"

[dependencies]
# tidy-alphabetical-start
bitflags = "1.2.1"
tracing = "0.1"
rand = { version = "0.8.4", default-features = false, optional = true }
rand_xoshiro = { version = "0.6.0", optional = true }
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
rustc_index = { path = "../rustc_index", default-features = false }
rustc_macros = { path = "../rustc_macros", optional = true }
rustc_serialize = { path = "../rustc_serialize", optional = true }
tracing = "0.1"
# tidy-alphabetical-end

[features]
# tidy-alphabetical-start
default = ["nightly", "randomize"]
randomize = ["rand", "rand_xoshiro", "nightly"]
# rust-analyzer depends on this crate and we therefore require it to built on a stable toolchain
# without depending on rustc_data_structures, rustc_macros and rustc_serialize
nightly = [
Expand All @@ -24,3 +26,5 @@ nightly = [
"rustc_macros",
"rustc_serialize",
]
randomize = ["rand", "rand_xoshiro", "nightly"]
# tidy-alphabetical-end
2 changes: 2 additions & 0 deletions compiler/rustc_arena/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ version = "0.0.0"
edition = "2021"

[dependencies]
# tidy-alphabetical-start
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
# tidy-alphabetical-end
6 changes: 3 additions & 3 deletions compiler/rustc_ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ name = "rustc_ast"
version = "0.0.0"
edition = "2021"

[lib]

[dependencies]
# tidy-alphabetical-start
bitflags = "1.2.1"
memchr = "2.5.0"
rustc_data_structures = { path = "../rustc_data_structures" }
Expand All @@ -14,8 +13,9 @@ rustc_lexer = { path = "../rustc_lexer" }
rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
# depends on Mutability and Movability, which could be uplifted into a common crate.
# For Mutability and Movability, which could be uplifted into a common crate.
rustc_type_ir = { path = "../rustc_type_ir" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
# tidy-alphabetical-end
6 changes: 4 additions & 2 deletions compiler/rustc_ast_lowering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ edition = "2021"
doctest = false

[dependencies]
# tidy-alphabetical-start
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_hir = { path = "../rustc_hir" }
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
rustc_hir = { path = "../rustc_hir" }
rustc_index = { path = "../rustc_index" }
rustc_middle = { path = "../rustc_middle" }
rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
# tidy-alphabetical-end
4 changes: 3 additions & 1 deletion compiler/rustc_ast_passes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ version = "0.0.0"
edition = "2021"

[dependencies]
# tidy-alphabetical-start
itertools = "0.10.1"
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_attr = { path = "../rustc_attr" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_feature = { path = "../rustc_feature" }
rustc_macros = { path = "../rustc_macros" }
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
rustc_macros = { path = "../rustc_macros" }
rustc_parse = { path = "../rustc_parse" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
thin-vec = "0.2.12"
tracing = "0.1"
# tidy-alphabetical-end
4 changes: 4 additions & 0 deletions compiler/rustc_ast_passes/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ ast_passes_const_and_async = functions cannot be both `const` and `async`
.async = `async` because of this
.label = {""}

ast_passes_const_and_c_variadic = functions cannot be both `const` and C-variadic
.const = `const` because of this
.variadic = C-variadic because of this

ast_passes_const_without_body =
free constant item without body
.suggestion = provide a definition for the constant
Expand Down
37 changes: 30 additions & 7 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,36 @@ impl<'a> AstValidator<'a> {
}
}

/// Reject C-variadic type unless the function is foreign,
/// or free and `unsafe extern "C"` semantically.
/// Reject invalid C-variadic types.
///
/// C-variadics must be:
/// - Non-const
/// - Either foreign, or free and `unsafe extern "C"` semantically
fn check_c_variadic_type(&self, fk: FnKind<'a>) {
let variadic_spans: Vec<_> = fk
.decl()
.inputs
.iter()
.filter(|arg| matches!(arg.ty.kind, TyKind::CVarArgs))
.map(|arg| arg.span)
.collect();

if variadic_spans.is_empty() {
return;
}

if let Some(header) = fk.header() {
if let Const::Yes(const_span) = header.constness {
let mut spans = variadic_spans.clone();
spans.push(const_span);
self.err_handler().emit_err(errors::ConstAndCVariadic {
spans,
const_span,
variadic_spans: variadic_spans.clone(),
});
}
}

match (fk.ctxt(), fk.header()) {
(Some(FnCtxt::Foreign), _) => return,
(Some(FnCtxt::Free), Some(header)) => match header.ext {
Expand All @@ -499,11 +526,7 @@ impl<'a> AstValidator<'a> {
_ => {}
};

for Param { ty, span, .. } in &fk.decl().inputs {
if let TyKind::CVarArgs = ty.kind {
self.err_handler().emit_err(errors::BadCVariadic { span: *span });
}
}
self.err_handler().emit_err(errors::BadCVariadic { span: variadic_spans });
}

fn check_item_named(&self, ident: Ident, kind: &str) {
Expand Down
13 changes: 12 additions & 1 deletion compiler/rustc_ast_passes/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ pub struct ExternItemAscii {
#[diag(ast_passes_bad_c_variadic)]
pub struct BadCVariadic {
#[primary_span]
pub span: Span,
pub span: Vec<Span>,
}

#[derive(Diagnostic)]
Expand Down Expand Up @@ -583,6 +583,17 @@ pub struct ConstAndAsync {
pub span: Span,
}

#[derive(Diagnostic)]
#[diag(ast_passes_const_and_c_variadic)]
pub struct ConstAndCVariadic {
#[primary_span]
pub spans: Vec<Span>,
#[label(ast_passes_const)]
pub const_span: Span,
#[label(ast_passes_variadic)]
pub variadic_spans: Vec<Span>,
}

#[derive(Diagnostic)]
#[diag(ast_passes_pattern_in_foreign, code = "E0130")]
pub struct PatternInForeign {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast_pretty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name = "rustc_ast_pretty"
version = "0.0.0"
edition = "2021"

[lib]

[dependencies]
# tidy-alphabetical-start
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }
thin-vec = "0.2.12"
# tidy-alphabetical-end
4 changes: 2 additions & 2 deletions compiler/rustc_attr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ name = "rustc_attr"
version = "0.0.0"
edition = "2021"

[lib]

[dependencies]
# tidy-alphabetical-start
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_data_structures = { path = "../rustc_data_structures" }
Expand All @@ -17,3 +16,4 @@ rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
# tidy-alphabetical-end
4 changes: 4 additions & 0 deletions compiler/rustc_baked_icu_data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ version = "0.0.0"
edition = "2021"

[dependencies]
# tidy-alphabetical-start
icu_list = "1.2"
icu_locid = "1.2"
icu_provider = "1.2"
icu_provider_adapters = "1.2"
zerovec = "0.9.4"
# tidy-alphabetical-end

[features]
# tidy-alphabetical-start
rustc_use_parallel_compiler = ['icu_provider/sync']
# tidy-alphabetical-end
12 changes: 6 additions & 6 deletions compiler/rustc_borrowck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ name = "rustc_borrowck"
version = "0.0.0"
edition = "2021"

[lib]

[dependencies]
# tidy-alphabetical-start
either = "1.5.0"
itertools = "0.10.1"
tracing = "0.1"
polonius-engine = "0.13.0"
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
rustc_graphviz = { path = "../rustc_graphviz" }
rustc_hir = { path = "../rustc_hir" }
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
rustc_index = { path = "../rustc_index" }
rustc_infer = { path = "../rustc_infer" }
rustc_lexer = { path = "../rustc_lexer" }
Expand All @@ -24,7 +21,10 @@ rustc_middle = { path = "../rustc_middle" }
rustc_mir_dataflow = { path = "../rustc_mir_dataflow" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_traits = { path = "../rustc_traits" }
rustc_span = { path = "../rustc_span" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
# tidy-alphabetical-end
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
}
TerminatorKind::UnwindTerminate(_) => {
if !is_cleanup {
span_mirbug!(self, block_data, "abort on non-cleanup block!")
span_mirbug!(self, block_data, "terminate on non-cleanup block!")
}
}
TerminatorKind::Return => {
Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_builtin_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,25 @@ edition = "2021"
doctest = false

[dependencies]
# tidy-alphabetical-start
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_attr = { path = "../rustc_attr" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_expand = { path = "../rustc_expand" }
rustc_feature = { path = "../rustc_feature" }
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
rustc_index = { path = "../rustc_index" }
rustc_lexer = { path = "../rustc_lexer" }
rustc_lint_defs = { path = "../rustc_lint_defs" }
rustc_macros = { path = "../rustc_macros" }
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
rustc_parse_format = { path = "../rustc_parse_format" }
rustc_parse = { path = "../rustc_parse" }
rustc_parse_format = { path = "../rustc_parse_format" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
# tidy-alphabetical-end
Loading
Loading