Skip to content

Commit ace8345

Browse files
committed
Rename #[pin_project] to #[pin_v2] to avoid naming conflicts
1 parent b36f15e commit ace8345

25 files changed

+535
-535
lines changed

compiler/rustc_attr_parsing/src/attributes/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub(crate) mod must_use;
4848
pub(crate) mod no_implicit_prelude;
4949
pub(crate) mod non_exhaustive;
5050
pub(crate) mod path;
51-
pub(crate) mod pin_project;
51+
pub(crate) mod pin_v2;
5252
pub(crate) mod proc_macro_attrs;
5353
pub(crate) mod prototype;
5454
pub(crate) mod repr;

compiler/rustc_attr_parsing/src/attributes/pin_project.rs renamed to compiler/rustc_attr_parsing/src/attributes/pin_v2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ use crate::context::Stage;
77
use crate::target_checking::AllowedTargets;
88
use crate::target_checking::Policy::Allow;
99

10-
pub(crate) struct PinProjectParser;
10+
pub(crate) struct PinV2Parser;
1111

12-
impl<S: Stage> NoArgsAttributeParser<S> for PinProjectParser {
13-
const PATH: &[Symbol] = &[sym::pin_project];
12+
impl<S: Stage> NoArgsAttributeParser<S> for PinV2Parser {
13+
const PATH: &[Symbol] = &[sym::pin_v2];
1414
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
1515
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
1616
Allow(Target::Enum),
1717
Allow(Target::Struct),
1818
Allow(Target::Union),
1919
]);
20-
const CREATE: fn(Span) -> AttributeKind = AttributeKind::PinProject;
20+
const CREATE: fn(Span) -> AttributeKind = AttributeKind::PinV2;
2121
}

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use crate::attributes::must_use::MustUseParser;
4747
use crate::attributes::no_implicit_prelude::NoImplicitPreludeParser;
4848
use crate::attributes::non_exhaustive::NonExhaustiveParser;
4949
use crate::attributes::path::PathParser as PathAttributeParser;
50-
use crate::attributes::pin_project::PinProjectParser;
50+
use crate::attributes::pin_v2::PinV2Parser;
5151
use crate::attributes::proc_macro_attrs::{
5252
ProcMacroAttributeParser, ProcMacroDeriveParser, ProcMacroParser, RustcBuiltinMacroParser,
5353
};
@@ -234,7 +234,7 @@ attribute_parsers!(
234234
Single<WithoutArgs<NonExhaustiveParser>>,
235235
Single<WithoutArgs<ParenSugarParser>>,
236236
Single<WithoutArgs<PassByValueParser>>,
237-
Single<WithoutArgs<PinProjectParser>>,
237+
Single<WithoutArgs<PinV2Parser>>,
238238
Single<WithoutArgs<PointeeParser>>,
239239
Single<WithoutArgs<ProcMacroAttributeParser>>,
240240
Single<WithoutArgs<ProcMacroParser>>,

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,13 +893,13 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
893893
EncodeCrossCrate::No, loop_match, experimental!(loop_match)
894894
),
895895

896-
// The `#[pin_project]` attribute is part of the `pin_ergonomics` experiment
896+
// The `#[pin_v2]` attribute is part of the `pin_ergonomics` experiment
897897
// that allows structurally pinning, tracked in:
898898
//
899899
// - https://github.com/rust-lang/rust/issues/130494
900900
gated!(
901-
pin_project, Normal, template!(Word), ErrorFollowing,
902-
EncodeCrossCrate::Yes, pin_ergonomics, experimental!(pin_project),
901+
pin_v2, Normal, template!(Word), ErrorFollowing,
902+
EncodeCrossCrate::Yes, pin_ergonomics, experimental!(pin_v2),
903903
),
904904

905905
// ==========================================================================

compiler/rustc_hir/src/attrs/data_structures.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ pub enum AttributeKind {
637637
/// Represents `#[pattern_complexity_limit]`
638638
PatternComplexityLimit { attr_span: Span, limit_span: Span, limit: Limit },
639639

640-
/// Represents `#[pin_project]`
641-
PinProject(Span),
640+
/// Represents `#[pin_v2]`
641+
PinV2(Span),
642642

643643
/// Represents `#[pointee]`
644644
Pointee(Span),

compiler/rustc_hir/src/attrs/encode_cross_crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl AttributeKind {
7777
PassByValue(..) => Yes,
7878
Path(..) => No,
7979
PatternComplexityLimit { .. } => No,
80-
PinProject(..) => Yes,
80+
PinV2(..) => Yes,
8181
Pointee(..) => No,
8282
ProcMacro(..) => No,
8383
ProcMacroAttribute(..) => No,

compiler/rustc_hir_typeck/messages.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ hir_typeck_pass_to_variadic_function = can't pass `{$ty}` to variadic function
227227
.suggestion = cast the value to `{$cast_ty}`
228228
.teach_help = certain types, like `{$ty}`, must be cast before passing them to a variadic function to match the implicit cast that a C compiler would perform as part of C's numeric promotion rules
229229
230-
hir_typeck_project_on_non_pin_project_type = cannot project on type that is not `#[pin_project]`
230+
hir_typeck_project_on_non_pin_project_type = cannot project on type that is not `#[pin_v2]`
231231
.note = type defined here
232-
.suggestion = add `#[pin_project]` here
232+
.suggestion = add `#[pin_v2]` here
233233
234234
hir_typeck_ptr_cast_add_auto_to_object = cannot add {$traits_len ->
235235
[1] auto trait {$traits}

compiler/rustc_hir_typeck/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,6 @@ pub(crate) struct ProjectOnNonPinProjectType {
11641164
pub span: Span,
11651165
#[note]
11661166
pub def_span: Option<Span>,
1167-
#[suggestion(code = "#[pin_project]\n", applicability = "machine-applicable")]
1167+
#[suggestion(code = "#[pin_v2]\n", applicability = "machine-applicable")]
11681168
pub sugg_span: Option<Span>,
11691169
}

compiler/rustc_hir_typeck/src/pat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
555555
debug!("scrutinee ty {expected:?} is a pinned reference, inserting pin deref");
556556

557557
// if the inner_ty is an ADT, make sure that it can be structurally pinned
558-
// (i.e., it is `#[pin_project]`).
558+
// (i.e., it is `#[pin_v2]`).
559559
if let Some(adt) = inner_ty.ty_adt_def()
560560
&& !adt.is_pin_project()
561561
&& !adt.is_pin()

compiler/rustc_middle/src/ty/adt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl AdtDefData {
288288
debug!("found non-exhaustive variant list for {:?}", did);
289289
flags = flags | AdtFlags::IS_VARIANT_LIST_NON_EXHAUSTIVE;
290290
}
291-
if find_attr!(tcx.get_all_attrs(did), AttributeKind::PinProject(..)) {
291+
if find_attr!(tcx.get_all_attrs(did), AttributeKind::PinV2(..)) {
292292
debug!("found pin-project type {:?}", did);
293293
flags |= AdtFlags::IS_PIN_PROJECT;
294294
}
@@ -445,7 +445,7 @@ impl<'tcx> AdtDef<'tcx> {
445445
self.flags().contains(AdtFlags::IS_PIN)
446446
}
447447

448-
/// Returns `true` is this is `#[pin_project]` for the purposes
448+
/// Returns `true` is this is `#[pin_v2]` for the purposes
449449
/// of structural pinning.
450450
#[inline]
451451
pub fn is_pin_project(self) -> bool {

0 commit comments

Comments
 (0)