Skip to content

Commit a1aaeb6

Browse files
committed
Rename unconstructible to unconstructable
1 parent f4930ea commit a1aaeb6

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ declare_lint_pass! {
112112
TYVAR_BEHIND_RAW_POINTER,
113113
UNCONDITIONAL_PANIC,
114114
UNCONDITIONAL_RECURSION,
115-
UNCONSTRUCTIBLE_PUB_STRUCT,
115+
UNCONSTRUCTABLE_PUB_STRUCT,
116116
UNCOVERED_PARAM_IN_PROJECTION,
117117
UNEXPECTED_CFGS,
118118
UNFULFILLED_LINT_EXPECTATIONS,
@@ -760,13 +760,13 @@ declare_lint! {
760760
}
761761

762762
declare_lint! {
763-
/// The `unconstructible_pub_struct` lint detects public structs that
763+
/// The `unconstructable_pub_struct` lint detects public structs that
764764
/// are unused locally and cannot be constructed externally.
765765
///
766766
/// ### Example
767767
///
768768
/// ```rust,compile_fail
769-
/// #![deny(unconstructible_pub_struct)]
769+
/// #![deny(unconstructable_pub_struct)]
770770
///
771771
/// pub struct Foo(i32);
772772
/// # fn main() {}
@@ -776,7 +776,7 @@ declare_lint! {
776776
///
777777
/// ### Explanation
778778
///
779-
/// Unconstructible pub structs may signal a mistake or unfinished code.
779+
/// Unconstructable pub structs may signal a mistake or unfinished code.
780780
/// To silence the warning for individual items, prefix the name with an
781781
/// underscore such as `_Foo`.
782782
///
@@ -786,7 +786,7 @@ declare_lint! {
786786
/// things like well-formedness.
787787
///
788788
/// Otherwise, consider removing it if the struct is no longer in use.
789-
pub UNCONSTRUCTIBLE_PUB_STRUCT,
789+
pub UNCONSTRUCTABLE_PUB_STRUCT,
790790
Allow,
791791
"detects pub structs that are unused locally and cannot be constructed externally"
792792
}

compiler/rustc_passes/messages.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,8 @@ passes_trait_impl_const_stable =
575575
passes_transparent_incompatible =
576576
transparent {$target} cannot have other repr hints
577577
578-
passes_unconstructible_pub_struct =
579-
pub struct `{$name}` is unconstructible externally and never constructed locally
578+
passes_unconstructable_pub_struct =
579+
pub struct `{$name}` is unconstructable externally and never constructed locally
580580
.help = this struct may be unused locally and also externally, consider removing it
581581
582582
passes_unexportable_adt_with_private_fields = ADT types with private fields are not exportable

compiler/rustc_passes/src/dead.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ use rustc_middle::middle::privacy::Level;
1919
use rustc_middle::query::Providers;
2020
use rustc_middle::ty::{self, AssocTag, TyCtxt};
2121
use rustc_middle::{bug, span_bug};
22-
use rustc_session::lint::builtin::{DEAD_CODE, UNCONSTRUCTIBLE_PUB_STRUCT};
22+
use rustc_session::lint::builtin::{DEAD_CODE, UNCONSTRUCTABLE_PUB_STRUCT};
2323
use rustc_session::lint::{self, LintExpectationId};
2424
use rustc_span::{Symbol, kw, sym};
2525

2626
use crate::errors::{
27-
ChangeFields, IgnoredDerivedImpls, MultipleDeadCodes, ParentInfo, UnconstructiblePubStruct,
27+
ChangeFields, IgnoredDerivedImpls, MultipleDeadCodes, ParentInfo, UnconstructablePubStruct,
2828
UselessAssignment,
2929
};
3030

@@ -772,9 +772,9 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
772772
}
773773
}
774774

775-
fn has_allow_unconstructible_pub_struct(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
775+
fn has_allow_unconstructable_pub_struct(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
776776
let hir_id = tcx.local_def_id_to_hir_id(def_id);
777-
let lint_level = tcx.lint_level_at_node(UNCONSTRUCTIBLE_PUB_STRUCT, hir_id).level;
777+
let lint_level = tcx.lint_level_at_node(UNCONSTRUCTABLE_PUB_STRUCT, hir_id).level;
778778
matches!(lint_level, lint::Allow | lint::Expect)
779779
}
780780

@@ -912,12 +912,12 @@ fn create_and_seed_worklist(
912912
true,
913913
),
914914
DefKind::Struct => (
915-
has_allow_unconstructible_pub_struct(tcx, *id)
915+
has_allow_unconstructable_pub_struct(tcx, *id)
916916
|| struct_can_be_constructed_directly(tcx, *id),
917917
false,
918918
),
919919
DefKind::Ctor(CtorOf::Struct, CtorKind::Fn) => (
920-
has_allow_unconstructible_pub_struct(tcx, tcx.local_parent(*id))
920+
has_allow_unconstructable_pub_struct(tcx, tcx.local_parent(*id))
921921
|| struct_can_be_constructed_directly(tcx, tcx.local_parent(*id)),
922922
false,
923923
),
@@ -1380,8 +1380,8 @@ fn check_mod_deathness(tcx: TyCtxt<'_>, module: LocalModDefId) {
13801380

13811381
let hir_id = tcx.local_def_id_to_hir_id(def_id);
13821382
let vis_span = tcx.hir_node(hir_id).expect_item().vis_span;
1383-
let diag = UnconstructiblePubStruct { name, vis_span };
1384-
tcx.emit_node_span_lint(UNCONSTRUCTIBLE_PUB_STRUCT, hir_id, tcx.hir_span(hir_id), diag);
1383+
let diag = UnconstructablePubStruct { name, vis_span };
1384+
tcx.emit_node_span_lint(UNCONSTRUCTABLE_PUB_STRUCT, hir_id, tcx.hir_span(hir_id), diag);
13851385
}
13861386
}
13871387

compiler/rustc_passes/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,8 +1250,8 @@ pub(crate) enum MultipleDeadCodes<'tcx> {
12501250
}
12511251

12521252
#[derive(LintDiagnostic)]
1253-
#[diag(passes_unconstructible_pub_struct)]
1254-
pub(crate) struct UnconstructiblePubStruct {
1253+
#[diag(passes_unconstructable_pub_struct)]
1254+
pub(crate) struct UnconstructablePubStruct {
12551255
pub name: Symbol,
12561256
#[help]
12571257
pub vis_span: Span,

tests/ui/lint/dead-code/unconstructible-pub-struct.rs renamed to tests/ui/lint/dead-code/unconstructable-pub-struct.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(never_type)]
2-
#![deny(unconstructible_pub_struct)]
2+
#![deny(unconstructable_pub_struct)]
33

44
pub struct T1(!);
55
pub struct T2(());
@@ -27,7 +27,7 @@ pub struct T8<X> {
2727
_x: std::marker::PhantomData<X>,
2828
}
2929

30-
pub struct T9<X> { //~ ERROR: pub struct `T9` is unconstructible externally and never constructed locally
30+
pub struct T9<X> { //~ ERROR: pub struct `T9` is unconstructable externally and never constructed locally
3131
_x: std::marker::PhantomData<X>,
3232
_y: i32,
3333
}
@@ -38,7 +38,7 @@ mod pri {
3838
pub struct Unreachable(i32);
3939
}
4040

41-
pub struct NeverConstructed(i32); //~ ERROR: pub struct `NeverConstructed` is unconstructible externally and never constructed locally
41+
pub struct NeverConstructed(i32); //~ ERROR: pub struct `NeverConstructed` is unconstructable externally and never constructed locally
4242

4343
impl NeverConstructed {
4444
pub fn not_construct_self(&self) {}

tests/ui/lint/dead-code/unconstructible-pub-struct.stderr renamed to tests/ui/lint/dead-code/unconstructable-pub-struct.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
error: pub struct `T9` is unconstructible externally and never constructed locally
2-
--> $DIR/unconstructible-pub-struct.rs:30:1
1+
error: pub struct `T9` is unconstructable externally and never constructed locally
2+
--> $DIR/unconstructable-pub-struct.rs:30:1
33
|
44
LL | pub struct T9<X> {
55
| ^^^^^^^^^^^^^^^^
66
|
77
help: this struct may be unused locally and also externally, consider removing it
8-
--> $DIR/unconstructible-pub-struct.rs:30:1
8+
--> $DIR/unconstructable-pub-struct.rs:30:1
99
|
1010
LL | pub struct T9<X> {
1111
| ^^^
1212
note: the lint level is defined here
13-
--> $DIR/unconstructible-pub-struct.rs:2:9
13+
--> $DIR/unconstructable-pub-struct.rs:2:9
1414
|
15-
LL | #![deny(unconstructible_pub_struct)]
15+
LL | #![deny(unconstructable_pub_struct)]
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
1717

18-
error: pub struct `NeverConstructed` is unconstructible externally and never constructed locally
19-
--> $DIR/unconstructible-pub-struct.rs:41:1
18+
error: pub struct `NeverConstructed` is unconstructable externally and never constructed locally
19+
--> $DIR/unconstructable-pub-struct.rs:41:1
2020
|
2121
LL | pub struct NeverConstructed(i32);
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2323
|
2424
help: this struct may be unused locally and also externally, consider removing it
25-
--> $DIR/unconstructible-pub-struct.rs:41:1
25+
--> $DIR/unconstructable-pub-struct.rs:41:1
2626
|
2727
LL | pub struct NeverConstructed(i32);
2828
| ^^^

0 commit comments

Comments
 (0)