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 #117135

Merged
merged 22 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
963131e
Derive `Ord`, `PartialOrd` and `Hash` for `SocketAddr*`
WaffleLapkin Oct 14, 2023
5c13c69
Add tests for `SocketAddrV6` ordering with scope_id and flowinfo
WaffleLapkin Oct 15, 2023
2bba98b
Avoid unnecessary renumbering
JonasAlaif Oct 16, 2023
66a554b
Add method to convert internal to stable constructs
celinval Oct 21, 2023
f613b26
Add `internal()` method counterpart to `stable()`
celinval Oct 23, 2023
421631a
Remove unsafe and `Rc`
celinval Oct 23, 2023
cb61816
compiler: Add target features for LoongArch
heiher Oct 19, 2023
6cf9423
tests: Add features-gate for LoongArch
heiher Oct 19, 2023
300d04d
tests/ui/abi/compatibility: Set min-llvm-version to 17 for LoongArch64
heiher Oct 24, 2023
ae86f59
Add test and remove double ref
celinval Oct 24, 2023
2b36547
Introduce `-C instrument-coverage=branch` to gate branch coverage
Swatinem Aug 21, 2023
68f5536
Migrate diagnostics in `rustc_hir_analysis/src/coherence/orphan.rs`
obeis Oct 3, 2023
90e3aae
Remove incomplete features from RPITIT/AFIT tests
compiler-errors Oct 24, 2023
f3d20be
suggest unwrap/expect for let binding type mismatch
chenyukang Oct 17, 2023
c07ff9c
Rollup merge of #116094 - Swatinem:coverage-branch-gate, r=wesleywiser
matthiaskrgr Oct 24, 2023
f3e18e4
Rollup merge of #116396 - obeis:hir-analysis-migrate-diagnostics-7, r…
matthiaskrgr Oct 24, 2023
845c414
Rollup merge of #116714 - WaffleLapkin:order-the-order, r=joshtriplett
matthiaskrgr Oct 24, 2023
61ff4db
Rollup merge of #116792 - JonasAlaif:renumber-fix, r=b-naber
matthiaskrgr Oct 24, 2023
7a0a2d2
Rollup merge of #116841 - chenyukang:yukang-suggest-unwrap-expect, r=…
matthiaskrgr Oct 24, 2023
84f0bef
Rollup merge of #116943 - heiher:target-features, r=wesleywiser
matthiaskrgr Oct 24, 2023
f131a0a
Rollup merge of #117010 - celinval:smir-internal, r=oli-obk
matthiaskrgr Oct 24, 2023
060bdfd
Rollup merge of #117127 - compiler-errors:incomplete, r=lqd
matthiaskrgr Oct 24, 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: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4525,6 +4525,7 @@ dependencies = [
"rustc_middle",
"rustc_span",
"rustc_target",
"scoped-tls",
"stable_mir",
"tracing",
]
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_borrowck/src/renumber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ impl<'a, 'tcx> MutVisitor<'tcx> for RegionRenumberer<'a, 'tcx> {

#[instrument(skip(self), level = "debug")]
fn visit_ty(&mut self, ty: &mut Ty<'tcx>, ty_context: TyContext) {
if matches!(ty_context, TyContext::ReturnTy(_)) {
// We will renumber the return ty when called again with `TyContext::LocalDecl`
return;
}
*ty = self.renumber_regions(*ty, || RegionCtxt::TyContext(ty_context));

debug!(?ty);
Expand Down
16 changes: 16 additions & 0 deletions compiler/rustc_codegen_ssa/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,19 @@ const CSKY_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
("hard-float-abi", Some(sym::csky_target_feature)),
// tidy-alphabetical-end
];

const LOONGARCH_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
// tidy-alphabetical-start
("d", Some(sym::loongarch_target_feature)),
("f", Some(sym::loongarch_target_feature)),
("lasx", Some(sym::loongarch_target_feature)),
("lbt", Some(sym::loongarch_target_feature)),
("lsx", Some(sym::loongarch_target_feature)),
("lvz", Some(sym::loongarch_target_feature)),
("ual", Some(sym::loongarch_target_feature)),
// tidy-alphabetical-end
];

/// When rustdoc is running, provide a list of all known features so that all their respective
/// primitives may be documented.
///
Expand All @@ -358,6 +371,7 @@ pub fn all_known_features() -> impl Iterator<Item = (&'static str, Option<Symbol
.chain(WASM_ALLOWED_FEATURES.iter())
.chain(BPF_ALLOWED_FEATURES.iter())
.chain(CSKY_ALLOWED_FEATURES)
.chain(LOONGARCH_ALLOWED_FEATURES)
.cloned()
}

Expand All @@ -373,6 +387,7 @@ pub fn supported_target_features(sess: &Session) -> &'static [(&'static str, Opt
"wasm32" | "wasm64" => WASM_ALLOWED_FEATURES,
"bpf" => BPF_ALLOWED_FEATURES,
"csky" => CSKY_ALLOWED_FEATURES,
"loongarch64" => LOONGARCH_ALLOWED_FEATURES,
_ => &[],
}
}
Expand Down Expand Up @@ -445,6 +460,7 @@ pub fn from_target_feature(
Some(sym::bpf_target_feature) => rust_features.bpf_target_feature,
Some(sym::aarch64_ver_target_feature) => rust_features.aarch64_ver_target_feature,
Some(sym::csky_target_feature) => rust_features.csky_target_feature,
Some(sym::loongarch_target_feature) => rust_features.loongarch_target_feature,
Some(name) => bug!("unknown target feature gate {}", name),
None => true,
};
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ declare_features! (
(unstable, csky_target_feature, "1.73.0", Some(44839), None),
(unstable, ermsb_target_feature, "1.49.0", Some(44839), None),
(unstable, hexagon_target_feature, "1.27.0", Some(44839), None),
(unstable, loongarch_target_feature, "1.73.0", Some(44839), None),
(unstable, mips_target_feature, "1.27.0", Some(44839), None),
(unstable, powerpc_target_feature, "1.27.0", Some(44839), None),
(unstable, riscv_target_feature, "1.45.0", Some(44839), None),
Expand Down
41 changes: 41 additions & 0 deletions compiler/rustc_hir_analysis/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ hir_analysis_copy_impl_on_type_with_dtor =
the trait `Copy` cannot be implemented for this type; the type has a destructor
.label = `Copy` not allowed on types with destructors

hir_analysis_cross_crate_traits = cross-crate traits with a default impl, like `{$traits}`, can only be implemented for a struct/enum type, not `{$self_ty}`
.label = can't implement cross-crate trait with a default impl for non-struct/enum type

hir_analysis_cross_crate_traits_defined = cross-crate traits with a default impl, like `{$traits}`, can only be implemented for a struct/enum type defined in the current crate
.label = can't implement cross-crate trait for type in another crate

hir_analysis_dispatch_from_dyn_multi = implementing the `DispatchFromDyn` trait requires multiple coercions
.note = the trait `DispatchFromDyn` may only be implemented for a coercion between structures with a single field being coerced
.coercions_note = currently, {$number} fields need coercions: {$coercions}
Expand Down Expand Up @@ -237,6 +243,28 @@ hir_analysis_must_implement_not_function_span_note = required by this annotation

hir_analysis_must_implement_one_of_attribute = the `#[rustc_must_implement_one_of]` attribute must be used with at least 2 args

hir_analysis_only_current_traits_arbitrary = only traits defined in the current crate can be implemented for arbitrary types

hir_analysis_only_current_traits_foreign = this is not defined in the current crate because this is a foreign trait

hir_analysis_only_current_traits_label = impl doesn't use only types from inside the current crate

hir_analysis_only_current_traits_name = this is not defined in the current crate because {$name} are always foreign

hir_analysis_only_current_traits_note = define and implement a trait or new type instead

hir_analysis_only_current_traits_opaque = type alias impl trait is treated as if it were foreign, because its hidden type could be from a foreign crate

hir_analysis_only_current_traits_outside = only traits defined in the current crate can be implemented for types defined outside of the crate

hir_analysis_only_current_traits_pointer = `{$pointer}` is not defined in the current crate because raw pointers are always foreign

hir_analysis_only_current_traits_pointer_sugg = consider introducing a new wrapper type

hir_analysis_only_current_traits_primitive = only traits defined in the current crate can be implemented for primitive types

hir_analysis_only_current_traits_ty = `{$ty}` is not defined in the current crate

hir_analysis_paren_sugar_attribute = the `#[rustc_paren_sugar]` attribute is a temporary means of controlling which traits can use parenthetical notation
.help = add `#![feature(unboxed_closures)]` to the crate attributes to use it

Expand Down Expand Up @@ -326,6 +354,9 @@ hir_analysis_trait_object_declared_with_no_traits =
at least one trait is required for an object type
.alias_span = this alias does not contain a trait

hir_analysis_traits_with_defualt_impl = traits with a default impl, like `{$traits}`, cannot be implemented for {$problematic_kind} `{$self_ty}`
.note = a trait object implements `{$traits}` if and only if `{$traits}` is one of the trait object's trait bounds

hir_analysis_transparent_enum_variant = transparent enum needs exactly one variant, but has {$number}
.label = needs exactly one variant, but has {$number}
.many_label = too many variants in `{$path}`
Expand All @@ -339,6 +370,16 @@ hir_analysis_transparent_non_zero_sized_enum = the variant of a transparent {$de
.label = needs at most one field with non-trivial size or alignment, but has {$field_count}
.labels = this field has non-zero size or requires alignment

hir_analysis_ty_param_first_local = type parameter `{$param_ty}` must be covered by another type when it appears before the first local type (`{$local_type}`)
.label = type parameter `{$param_ty}` must be covered by another type when it appears before the first local type (`{$local_type}`)
.note = implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
.case_note = in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

hir_analysis_ty_param_some = type parameter `{$param_ty}` must be used as the type parameter for some local type (e.g., `MyStruct<{$param_ty}>`)
.label = type parameter `{$param_ty}` must be used as the type parameter for some local type
.note = implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
.only_note = only traits defined in the current crate can be implemented for a type parameter

hir_analysis_type_of = {$type_of}

hir_analysis_typeof_reserved_keyword_used =
Expand Down
Loading
Loading