Skip to content

Commit 497ad71

Browse files
committed
Rename unconstructible to unconstructable
1 parent 095d1e9 commit 497ad71

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
@@ -110,7 +110,7 @@ declare_lint_pass! {
110110
TYVAR_BEHIND_RAW_POINTER,
111111
UNCONDITIONAL_PANIC,
112112
UNCONDITIONAL_RECURSION,
113-
UNCONSTRUCTIBLE_PUB_STRUCT,
113+
UNCONSTRUCTABLE_PUB_STRUCT,
114114
UNCOVERED_PARAM_IN_PROJECTION,
115115
UNEXPECTED_CFGS,
116116
UNFULFILLED_LINT_EXPECTATIONS,
@@ -757,13 +757,13 @@ declare_lint! {
757757
}
758758

759759
declare_lint! {
760-
/// The `unconstructible_pub_struct` lint detects public structs that
760+
/// The `unconstructable_pub_struct` lint detects public structs that
761761
/// are unused locally and cannot be constructed externally.
762762
///
763763
/// ### Example
764764
///
765765
/// ```rust,compile_fail
766-
/// #![deny(unconstructible_pub_struct)]
766+
/// #![deny(unconstructable_pub_struct)]
767767
///
768768
/// pub struct Foo(i32);
769769
/// # fn main() {}
@@ -773,7 +773,7 @@ declare_lint! {
773773
///
774774
/// ### Explanation
775775
///
776-
/// Unconstructible pub structs may signal a mistake or unfinished code.
776+
/// Unconstructable pub structs may signal a mistake or unfinished code.
777777
/// To silence the warning for individual items, prefix the name with an
778778
/// underscore such as `_Foo`.
779779
///
@@ -783,7 +783,7 @@ declare_lint! {
783783
/// things like well-formedness.
784784
///
785785
/// Otherwise, consider removing it if the struct is no longer in use.
786-
pub UNCONSTRUCTIBLE_PUB_STRUCT,
786+
pub UNCONSTRUCTABLE_PUB_STRUCT,
787787
Allow,
788788
"detects pub structs that are unused locally and cannot be constructed externally"
789789
}

compiler/rustc_passes/messages.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ passes_trait_impl_const_stable =
576576
passes_transparent_incompatible =
577577
transparent {$target} cannot have other repr hints
578578
579-
passes_unconstructible_pub_struct =
580-
pub struct `{$name}` is unconstructible externally and never constructed locally
579+
passes_unconstructable_pub_struct =
580+
pub struct `{$name}` is unconstructable externally and never constructed locally
581581
.help = this struct may be unused locally and also externally, consider removing it
582582
583583
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
@@ -18,12 +18,12 @@ use rustc_middle::middle::privacy::Level;
1818
use rustc_middle::query::Providers;
1919
use rustc_middle::ty::{self, AssocTag, TyCtxt};
2020
use rustc_middle::{bug, span_bug};
21-
use rustc_session::lint::builtin::{DEAD_CODE, UNCONSTRUCTIBLE_PUB_STRUCT};
21+
use rustc_session::lint::builtin::{DEAD_CODE, UNCONSTRUCTABLE_PUB_STRUCT};
2222
use rustc_session::lint::{self, LintExpectationId};
2323
use rustc_span::{Symbol, kw, sym};
2424

2525
use crate::errors::{
26-
ChangeFields, IgnoredDerivedImpls, MultipleDeadCodes, ParentInfo, UnconstructiblePubStruct,
26+
ChangeFields, IgnoredDerivedImpls, MultipleDeadCodes, ParentInfo, UnconstructablePubStruct,
2727
UselessAssignment,
2828
};
2929

@@ -733,9 +733,9 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
733733
}
734734
}
735735

736-
fn has_allow_unconstructible_pub_struct(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
736+
fn has_allow_unconstructable_pub_struct(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
737737
let hir_id = tcx.local_def_id_to_hir_id(def_id);
738-
let lint_level = tcx.lint_level_at_node(UNCONSTRUCTIBLE_PUB_STRUCT, hir_id).level;
738+
let lint_level = tcx.lint_level_at_node(UNCONSTRUCTABLE_PUB_STRUCT, hir_id).level;
739739
matches!(lint_level, lint::Allow | lint::Expect)
740740
}
741741

@@ -873,12 +873,12 @@ fn create_and_seed_worklist(
873873
true,
874874
),
875875
DefKind::Struct => (
876-
has_allow_unconstructible_pub_struct(tcx, *id)
876+
has_allow_unconstructable_pub_struct(tcx, *id)
877877
|| struct_can_be_constructed_directly(tcx, *id),
878878
false,
879879
),
880880
DefKind::Ctor(CtorOf::Struct, CtorKind::Fn) => (
881-
has_allow_unconstructible_pub_struct(tcx, tcx.local_parent(*id))
881+
has_allow_unconstructable_pub_struct(tcx, tcx.local_parent(*id))
882882
|| struct_can_be_constructed_directly(tcx, tcx.local_parent(*id)),
883883
false,
884884
),
@@ -1333,8 +1333,8 @@ fn check_mod_deathness(tcx: TyCtxt<'_>, module: LocalModDefId) {
13331333

13341334
let hir_id = tcx.local_def_id_to_hir_id(def_id);
13351335
let vis_span = tcx.hir_node(hir_id).expect_item().vis_span;
1336-
let diag = UnconstructiblePubStruct { name, vis_span };
1337-
tcx.emit_node_span_lint(UNCONSTRUCTIBLE_PUB_STRUCT, hir_id, tcx.hir_span(hir_id), diag);
1336+
let diag = UnconstructablePubStruct { name, vis_span };
1337+
tcx.emit_node_span_lint(UNCONSTRUCTABLE_PUB_STRUCT, hir_id, tcx.hir_span(hir_id), diag);
13381338
}
13391339
}
13401340

compiler/rustc_passes/src/errors.rs

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

12531253
#[derive(LintDiagnostic)]
1254-
#[diag(passes_unconstructible_pub_struct)]
1255-
pub(crate) struct UnconstructiblePubStruct {
1254+
#[diag(passes_unconstructable_pub_struct)]
1255+
pub(crate) struct UnconstructablePubStruct {
12561256
pub name: Symbol,
12571257
#[help]
12581258
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)