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 7 pull requests #101355

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f46fffc
safe transmute: use `Assume` struct to provide analysis options
jswrenn Aug 18, 2022
1d844fe
safe transmute: use `FxIndex{Map,Set}` instead of `FxHash{Map,Set}`
jswrenn Aug 23, 2022
54645e8
set up rustc_metadata for SessionDiagnostics, port dependency_format.rs
CleanCut Aug 23, 2022
3ed9310
port native_libs.rs to SessionDiagnostics
CleanCut Aug 23, 2022
f7e462a
port encoder.rs to SessionDiagnostics
CleanCut Aug 23, 2022
32e1823
port creader.rs to SessionDiagnostics
CleanCut Aug 23, 2022
bd8e312
port fs.rs to SessionDiagnostics
CleanCut Aug 23, 2022
d0ba1fb
port of locator.rs to SessionDiagnostics, fix some of the errors
CleanCut Aug 24, 2022
0d65819
respond to review feedback: mainly eliminate as many conversions as p…
CleanCut Aug 26, 2022
30adfd6
port 5 new diagnostics that appeared in master
CleanCut Aug 27, 2022
fbcc038
safe transmute: use `to_valtree` to destructure const `Assume`
jswrenn Aug 31, 2022
e4e4114
Only keep one version of ImplicitSelfKind.
cjgillot Aug 27, 2022
f848d27
Use tcx.hir() utils for spans in MIR building.
cjgillot Aug 27, 2022
26037b1
Simplify MIR building entry.
cjgillot Aug 27, 2022
609a90d
Compute explicit MIR params on THIR.
cjgillot Aug 27, 2022
692064b
Also compute implicit params in THIR.
cjgillot Aug 22, 2022
8a594f0
Shrink some visibilities.
cjgillot Aug 29, 2022
d85dff7
Bless codegen test.
cjgillot Aug 30, 2022
b9e1806
Use def_span for external requirements.
cjgillot Aug 31, 2022
bc793c9
Use `BCRYPT_RNG_ALG_HANDLE` by default
ChrisDenton Sep 2, 2022
532d5f2
Fix `std::collections::HashSet::drain` documentation
wkordalski Sep 2, 2022
6fbc4d9
Fix unsupported syntax in .manifest file
diminishedprime Sep 2, 2022
df09047
rustdoc: remove unused CSS selector `.methods > .item-info`
notriddle Sep 2, 2022
6f95c89
rustdoc: remove incorrect CSS rule causing misaligned item-info
notriddle Sep 2, 2022
0f29824
rustdoc: put in rule to get alignment in desktop and mobile layouts
notriddle Sep 2, 2022
e135e37
Rollup merge of #100726 - jswrenn:transmute, r=oli-obk
matthiaskrgr Sep 3, 2022
6395082
Rollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davi…
matthiaskrgr Sep 3, 2022
2c0a225
Rollup merge of #101086 - cjgillot:thir-param, r=oli-obk
matthiaskrgr Sep 3, 2022
2739e70
Rollup merge of #101325 - ChrisDenton:BCRYPT_RNG_ALG_HANDLE, r=thomcc
matthiaskrgr Sep 3, 2022
afed4ff
Rollup merge of #101330 - wkordalski:hashset-drain-doc, r=jyn514
matthiaskrgr Sep 3, 2022
297793c
Rollup merge of #101335 - notriddle:notriddle/methods-stability, r=no…
matthiaskrgr Sep 3, 2022
f0fcbca
Rollup merge of #101338 - diminishedprime:patch-2, r=tmandry
matthiaskrgr Sep 3, 2022
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
2 changes: 2 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3509,6 +3509,7 @@ dependencies = [
"rustc_macros",
"rustc_serialize",
"rustc_span",
"rustc_target",
"serde",
"serde_json",
"termcolor",
Expand Down Expand Up @@ -4233,6 +4234,7 @@ version = "0.1.0"
dependencies = [
"itertools",
"rustc_data_structures",
"rustc_hir",
"rustc_infer",
"rustc_macros",
"rustc_middle",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/diagnostics/move_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {

diag.span_label(upvar_span, "captured outer variable");
diag.span_label(
self.body.span,
self.infcx.tcx.def_span(def_id),
format!("captured by this `{closure_kind}` closure"),
);

Expand Down
14 changes: 6 additions & 8 deletions compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use rustc_middle::mir::{Mutability, Place, PlaceRef, ProjectionElem};
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_middle::{
hir::place::PlaceBase,
mir::{
self, BindingForm, ClearCrossCrate, ImplicitSelfKind, Local, LocalDecl, LocalInfo,
LocalKind, Location,
},
mir::{self, BindingForm, ClearCrossCrate, Local, LocalDecl, LocalInfo, LocalKind, Location},
};
use rustc_span::source_map::DesugaringKind;
use rustc_span::symbol::{kw, Symbol};
Expand Down Expand Up @@ -312,7 +309,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
&& !matches!(
decl.local_info,
Some(box LocalInfo::User(ClearCrossCrate::Set(BindingForm::ImplicitSelf(
ImplicitSelfKind::MutRef
hir::ImplicitSelfKind::MutRef
))))
)
{
Expand Down Expand Up @@ -976,6 +973,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {

let hir = self.infcx.tcx.hir();
let closure_id = self.mir_hir_id();
let closure_span = self.infcx.tcx.def_span(self.mir_def_id());
let fn_call_id = hir.get_parent_node(closure_id);
let node = hir.get(fn_call_id);
let def_id = hir.enclosing_body_owner(fn_call_id);
Expand Down Expand Up @@ -1027,7 +1025,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
if let Some(span) = arg {
err.span_label(span, "change this to accept `FnMut` instead of `Fn`");
err.span_label(func.span, "expects `Fn` instead of `FnMut`");
err.span_label(self.body.span, "in this closure");
err.span_label(closure_span, "in this closure");
look_at_return = false;
}
}
Expand All @@ -1053,7 +1051,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
sig.decl.output.span(),
"change this to return `FnMut` instead of `Fn`",
);
err.span_label(self.body.span, "in this closure");
err.span_label(closure_span, "in this closure");
}
_ => {}
}
Expand All @@ -1077,7 +1075,7 @@ fn mut_borrow_of_mutable_ref(local_decl: &LocalDecl<'_>, local_name: Option<Symb
//
// Deliberately fall into this case for all implicit self types,
// so that we don't fall in to the next case with them.
*kind == mir::ImplicitSelfKind::MutRef
*kind == hir::ImplicitSelfKind::MutRef
}
_ if Some(kw::SelfLower) == local_name => {
// Otherwise, check if the name is the `self` keyword - in which case
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_borrowck/src/nll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,9 @@ pub(super) fn dump_annotation<'a, 'tcx>(
// viewing the intraprocedural state, the -Zdump-mir output is
// better.

let def_span = tcx.def_span(body.source.def_id());
let mut err = if let Some(closure_region_requirements) = closure_region_requirements {
let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "external requirements");
let mut err = tcx.sess.diagnostic().span_note_diag(def_span, "external requirements");

regioncx.annotate(tcx, &mut err);

Expand All @@ -409,7 +410,7 @@ pub(super) fn dump_annotation<'a, 'tcx>(

err
} else {
let mut err = tcx.sess.diagnostic().span_note_diag(body.span, "no external requirements");
let mut err = tcx.sess.diagnostic().span_note_diag(def_span, "no external requirements");
regioncx.annotate(tcx, &mut err);

err
Expand Down
272 changes: 272 additions & 0 deletions compiler/rustc_error_messages/locales/en-US/metadata.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
metadata_rlib_required =
crate `{$crate_name}` required to be available in rlib format, but was not found in this form

metadata_lib_required =
crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form

metadata_crate_dep_multiple =
cannot satisfy dependencies so `{$crate_name}` only shows up once
.help = having upstream crates all available in one format will likely make this go away

metadata_two_panic_runtimes =
cannot link together two panic runtimes: {$prev_name} and {$cur_name}

metadata_bad_panic_strategy =
the linked panic runtime `{$runtime}` is not compiled with this crate's panic strategy `{$strategy}`

metadata_required_panic_strategy =
the crate `{$crate_name}` requires panic strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}`

metadata_incompatible_panic_in_drop_strategy =
the crate `{$crate_name}` is compiled with the panic-in-drop strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}`

metadata_multiple_names_in_link =
multiple `name` arguments in a single `#[link]` attribute

metadata_multiple_kinds_in_link =
multiple `kind` arguments in a single `#[link]` attribute

metadata_link_name_form =
link name must be of the form `name = "string"`

metadata_link_kind_form =
link kind must be of the form `kind = "string"`

metadata_link_modifiers_form =
link modifiers must be of the form `modifiers = "string"`

metadata_link_cfg_form =
link cfg must be of the form `cfg(/* predicate */)`

metadata_wasm_import_form =
wasm import module must be of the form `wasm_import_module = "string"`

metadata_empty_link_name =
link name must not be empty
.label = empty link name

metadata_link_framework_apple =
link kind `framework` is only supported on Apple targets

metadata_framework_only_windows =
link kind `raw-dylib` is only supported on Windows targets

metadata_unknown_link_kind =
unknown link kind `{$kind}`, expected one of: static, dylib, framework, raw-dylib
.label = unknown link kind

metadata_multiple_link_modifiers =
multiple `modifiers` arguments in a single `#[link]` attribute

metadata_multiple_cfgs =
multiple `cfg` arguments in a single `#[link]` attribute

metadata_link_cfg_single_predicate =
link cfg must have a single predicate argument

metadata_multiple_wasm_import =
multiple `wasm_import_module` arguments in a single `#[link]` attribute

metadata_unexpected_link_arg =
unexpected `#[link]` argument, expected one of: name, kind, modifiers, cfg, wasm_import_module, import_name_type

metadata_invalid_link_modifier =
invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed

metadata_multiple_modifiers =
multiple `{$modifier}` modifiers in a single `modifiers` argument

metadata_bundle_needs_static =
linking modifier `bundle` is only compatible with `static` linking kind

metadata_whole_archive_needs_static =
linking modifier `whole-archive` is only compatible with `static` linking kind

metadata_as_needed_compatibility =
linking modifier `as-needed` is only compatible with `dylib` and `framework` linking kinds

metadata_unknown_link_modifier =
unknown linking modifier `{$modifier}`, expected one of: bundle, verbatim, whole-archive, as-needed

metadata_incompatible_wasm_link =
`wasm_import_module` is incompatible with other arguments in `#[link]` attributes

metadata_link_requires_name =
`#[link]` attribute requires a `name = "string"` argument
.label = missing `name` argument

metadata_raw_dylib_no_nul =
link name must not contain NUL characters if link kind is `raw-dylib`

metadata_link_ordinal_raw_dylib =
`#[link_ordinal]` is only supported if link kind is `raw-dylib`

metadata_lib_framework_apple =
library kind `framework` is only supported on Apple targets

metadata_empty_renaming_target =
an empty renaming target was specified for library `{$lib_name}`

metadata_renaming_no_link =
renaming of the library `{$lib_name}` was specified, however this crate contains no `#[link(...)]` attributes referencing this library

metadata_multiple_renamings =
multiple renamings were specified for library `{$lib_name}`

metadata_no_link_mod_override =
overriding linking modifiers from command line is not supported

metadata_unsupported_abi_i686 =
ABI not supported by `#[link(kind = "raw-dylib")]` on i686

metadata_unsupported_abi =
ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture

metadata_fail_create_file_encoder =
failed to create file encoder: {$err}

metadata_fail_seek_file =
failed to seek the file: {$err}

metadata_fail_write_file =
failed to write to the file: {$err}

metadata_crate_not_panic_runtime =
the crate `{$crate_name}` is not a panic runtime

metadata_no_panic_strategy =
the crate `{$crate_name}` does not have the panic strategy `{$strategy}`

metadata_profiler_builtins_needs_core =
`profiler_builtins` crate (required by compiler options) is not compatible with crate attribute `#![no_core]`

metadata_not_profiler_runtime =
the crate `{$crate_name}` is not a profiler runtime

metadata_no_multiple_global_alloc =
cannot define multiple global allocators
.label = cannot define a new global allocator

metadata_prev_global_alloc =
previous global allocator defined here

metadata_conflicting_global_alloc =
the `#[global_allocator]` in {$other_crate_name} conflicts with global allocator in: {$crate_name}

metadata_global_alloc_required =
no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait

metadata_no_transitive_needs_dep =
the crate `{$crate_name}` cannot depend on a crate that needs {$needs_crate_name}, but it depends on `{$deps_crate_name}`

metadata_failed_write_error =
failed to write {$filename}: {$err}

metadata_failed_create_tempdir =
couldn't create a temp dir: {$err}

metadata_failed_create_file =
failed to create the file {$filename}: {$err}

metadata_failed_create_encoded_metadata =
failed to create encoded metadata from file: {$err}

metadata_non_ascii_name =
cannot load a crate with a non-ascii name `{$crate_name}`

metadata_extern_location_not_exist =
extern location for {$crate_name} does not exist: {$location}

metadata_extern_location_not_file =
extern location for {$crate_name} is not a file: {$location}

metadata_multiple_candidates =
multiple {$flavor} candidates for `{$crate_name}` found

metadata_multiple_matching_crates =
multiple matching crates for `{$crate_name}`
.note = candidates:{$candidates}

metadata_symbol_conflicts_current =
the current crate is indistinguishable from one of its dependencies: it has the same crate-name `{$crate_name}` and was compiled with the same `-C metadata` arguments. This will result in symbol conflicts between the two.

metadata_symbol_conflicts_others =
found two different crates with name `{$crate_name}` that are not distinguished by differing `-C metadata`. This will result in symbol conflicts between the two.

metadata_stable_crate_id_collision =
found crates (`{$crate_name0}` and `{$crate_name1}`) with colliding StableCrateId values.

metadata_dl_error =
{$err}

metadata_newer_crate_version =
found possibly newer version of crate `{$crate_name}`{$add_info}
.note = perhaps that crate needs to be recompiled?

metadata_found_crate_versions =
the following crate versions were found:{$found_crates}

metadata_no_crate_with_triple =
couldn't find crate `{$crate_name}` with expected target triple {$locator_triple}{$add_info}

metadata_found_staticlib =
found staticlib `{$crate_name}` instead of rlib or dylib{$add_info}
.help = please recompile that crate using --crate-type lib

metadata_incompatible_rustc =
found crate `{$crate_name}` compiled by an incompatible version of rustc{$add_info}
.help = please recompile that crate using this compiler ({$rustc_version}) (consider running `cargo clean` first)

metadata_invalid_meta_files =
found invalid metadata files for crate `{$crate_name}`{$add_info}

metadata_cannot_find_crate =
can't find crate for `{$crate_name}`{$add_info}

metadata_no_dylib_plugin =
plugin `{$crate_name}` only found in rlib format, but must be available in dylib format

metadata_target_not_installed =
the `{$locator_triple}` target may not be installed

metadata_target_no_std_support =
the `{$locator_triple}` target may not support the standard library

metadata_consider_downloading_target =
consider downloading the target with `rustup target add {$locator_triple}`

metadata_std_required =
`std` is required by `{$current_crate}` because it does not declare `#![no_std]`

metadata_consider_building_std =
consider building the standard library from source with `cargo build -Zbuild-std`

metadata_compiler_missing_profiler =
the compiler may have been built without the profiler runtime

metadata_install_missing_components =
maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

metadata_cant_find_crate =
can't find crate

metadata_crate_location_unknown_type =
extern location for {$crate_name} is of an unknown type: {$path}

metadata_lib_filename_form =
file name should be lib*.rlib or {dll_prefix}*.{dll_suffix}

metadata_multiple_import_name_type =
multiple `import_name_type` arguments in a single `#[link]` attribute

metadata_import_name_type_form =
import name type must be of the form `import_name_type = "string"`

metadata_import_name_type_x86 =
import name type is only supported on x86

metadata_unknown_import_name_type =
unknown import name type `{$import_name_type}`, expected one of: decorated, noprefix, undecorated

metadata_import_name_type_raw =
import name type can only be used with link kind `raw-dylib`
1 change: 1 addition & 0 deletions compiler/rustc_error_messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fluent_messages! {
infer => "../locales/en-US/infer.ftl",
lint => "../locales/en-US/lint.ftl",
monomorphize => "../locales/en-US/monomorphize.ftl",
metadata => "../locales/en-US/metadata.ftl",
parser => "../locales/en-US/parser.ftl",
passes => "../locales/en-US/passes.ftl",
plugin_impl => "../locales/en-US/plugin_impl.ftl",
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ rustc_macros = { path = "../rustc_macros" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_hir = { path = "../rustc_hir" }
rustc_lint_defs = { path = "../rustc_lint_defs" }
rustc_target = { path = "../rustc_target" }
unicode-width = "0.1.4"
atty = "0.2"
termcolor = "1.0"
annotate-snippets = "0.9"
termize = "0.1.1"
serde = { version = "1.0.125", features = ["derive"] }
serde = { version = "1.0.125", features = [ "derive" ] }
serde_json = "1.0.59"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["handleapi", "synchapi", "winbase"] }
winapi = { version = "0.3", features = [ "handleapi", "synchapi", "winbase" ] }
Loading