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

Rename optin_builtin_traits to auto_traits #79336

Merged
merged 2 commits into from
Nov 25, 2020

Conversation

camelid
Copy link
Member

@camelid camelid commented Nov 23, 2020

They were originally called "opt-in, built-in traits" (OIBITs), but
people realized that the name was too confusing and a mouthful, and so
they were renamed to just "auto traits". The feature flag's name wasn't
updated, though, so that's what this PR does.

There are some other spots in the compiler that still refer to OIBITs,
but I don't think changing those now is worth it since they are internal
and not particularly relevant to this PR.

Also see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name.

r? @oli-obk (feel free to re-assign if you're not the right reviewer for this)

@camelid camelid added A-trait-system Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Nov 23, 2020
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 23, 2020
@camelid

This comment has been minimized.

@camelid

This comment has been minimized.

library/core/src/lib.rs Outdated Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented Nov 23, 2020

There are some other spots in the compiler that still refer to OIBITs,
but I don't think changing those now is worth it since they are internal
and not particularly relevant to this PR.

How extensive is the usage of the name? I think if we're doing the name change, we should do it everywhere

@camelid
Copy link
Member Author

camelid commented Nov 23, 2020

There are some other spots in the compiler that still refer to OIBITs,
but I don't think changing those now is worth it since they are internal
and not particularly relevant to this PR.

How extensive is the usage of the name? I think if we're doing the name change, we should do it everywhere

Let me know what you want me to update!

$ rg -i '(oibit|opt-?in,?[ |_]?built-?in)' -g '!src/tools/rust-analyzer'
src/test/ui/phantom-oibit.stderr:  --> $DIR/phantom-oibit.rs:21:12
src/test/ui/phantom-oibit.stderr:  --> $DIR/phantom-oibit.rs:26:12
src/test/ui/phantom-oibit.rs:// Ensure that OIBIT checks `T` when it encounters a `PhantomData<T>` field, instead of checking
src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.rs:// OIBIT-based version of #29859, supertrait version. Test that using
src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.rs:// a simple OIBIT `..` impl alone still doesn't allow arbitrary bounds
src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.stderr:  --> $DIR/traits-inductive-overflow-supertrait-oibit.rs:8:19
src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.stderr:  --> $DIR/traits-inductive-overflow-supertrait-oibit.rs:16:23
src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs:pub auto trait AnOibit {}
src/test/rustdoc/impl-parts.rs:pub auto trait AnOibit {}
src/test/rustdoc/impl-parts.rs://     "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
src/test/rustdoc/impl-parts.rs:// @has impl_parts/trait.AnOibit.html '//*[@class="item-list"]//code' \
src/test/rustdoc/impl-parts.rs://     "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
src/test/rustdoc/impl-parts.rs:impl<T: Clone> !AnOibit for Foo<T> where T: Sync {}
src/test/rustdoc/impl-parts-crosscrate.rs:// @has implementors/rustdoc_impl_parts_crosscrate/trait.AnOibit.js Bar
src/test/rustdoc/impl-parts-crosscrate.rs:// @has - !AnOibit
src/test/rustdoc/impl-parts-crosscrate.rs:impl<T: Send> !rustdoc_impl_parts_crosscrate::AnOibit for Bar<T>
compiler/rustc_middle/src/mir/mod.rs:    /// therefore don't affect the OIBIT or outlives properties of the
compiler/rustc_feature/src/removed.rs:    /// Allows features specific to OIBIT (now called auto traits).
compiler/rustc_feature/src/removed.rs:    (removed, optin_builtin_traits, "1.0.0", Some(13231), None,
compiler/rustc_feature/src/active.rs:    /// Renamed from `optin_builtin_traits`.
compiler/rustc_middle/src/traits/mod.rs:    /// There are some exceptions, e.g., around OIBITS and
compiler/rustc_mir_build/src/build/expr/as_rvalue.rs:                // and therefore is not considered during generator OIBIT
compiler/rustc_error_codes/src/error_codes/E0380.md:the [opt-in builtin traits RFC][RFC 19].
compiler/rustc_error_codes/src/error_codes/E0192.md:information see the [opt-in builtin traits RFC][RFC 19].
RELEASES.md:* The final bits of [OIBIT landed][oibit-final], meaning that traits
RELEASES.md:[oibit-final]: https://github.com/rust-lang/rust/pull/21689
RELEASES.md:      footguns and are collectively known as [opt-in built-in
RELEASES.md:      traits][oibit] (though `Sync` and `Send` will soon become pure
RELEASES.md:[oibit]: https://github.com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md
library/rtstartup/rsbegin.rs:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
library/rtstartup/rsend.rs:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
library/proc_macro/src/lib.rs:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
library/std/src/lib.rs:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
library/core/src/lib.rs:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
library/alloc/src/lib.rs:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]

They were originally called "opt-in, built-in traits" (OIBITs), but
people realized that the name was too confusing and a mouthful, and so
they were renamed to just "auto traits". The feature flag's name wasn't
updated, though, so that's what this PR does.

There are some other spots in the compiler that still refer to OIBITs,
but I don't think changing those now is worth it since they are internal
and not particularly relevant to this PR.

Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
@camelid
Copy link
Member Author

camelid commented Nov 23, 2020

Squashed.

camelid added a commit to camelid/rustc-dev-guide that referenced this pull request Nov 23, 2020
How to remove them and how to rename them.

cc <rust-lang/rust#79336 (comment)>
cc @varkor
@oli-obk
Copy link
Contributor

oli-obk commented Nov 24, 2020

Let me know what you want me to update!

Ideally all of it, even the filenames. Though it's also fine to just paste your list in an E-easy issue if you prefer.

@camelid camelid added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2020
@camelid
Copy link
Member Author

camelid commented Nov 24, 2020

Should I change the name that the RFC is referenced by in the error codes? I feel like it might be confusing to see them called "auto traits" everywhere else, even though the RFC is called OIBIT. Maybe call it OIBIT, but mention that it's now called auto traits? Or something else?

@camelid
Copy link
Member Author

camelid commented Nov 24, 2020

These are the remaining references:

❯ rg -i '(oibit|opt-?in,?[ |_]?built-?in)' -g '!src/tools/rust-analyzer'
compiler/rustc_feature/src/removed.rs
74:    /// Allows features specific to OIBIT (now called auto traits).
76:    (removed, optin_builtin_traits, "1.0.0", Some(13231), None,

compiler/rustc_feature/src/active.rs
216:    /// Renamed from `optin_builtin_traits`.

compiler/rustc_span/src/symbol.rs
773:        optin_builtin_traits,

compiler/rustc_error_codes/src/error_codes/E0380.md
12:the [opt-in builtin traits RFC][RFC 19].

compiler/rustc_error_codes/src/error_codes/E0192.md
18:information see the [opt-in builtin traits RFC][RFC 19].

compiler/rustc_data_structures/src/lib.rs
18:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]

src/tools/cargo/tests/testsuite/custom_target.rs
65:        // Requires features no_core, lang_items, optin_builtin_traits
87:                #![feature(optin_builtin_traits)]

library/std/src/lib.rs
289:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]

library/core/src/lib.rs
122:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]

library/rtstartup/rsbegin.rs
17:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]

library/rtstartup/rsend.rs
5:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]

library/proc_macro/src/lib.rs
31:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]

library/alloc/src/lib.rs
115:#![cfg_attr(bootstrap, feature(optin_builtin_traits))]

RELEASES.md
7837:* The final bits of [OIBIT landed][oibit-final], meaning that traits
7941:[oibit-final]: https://github.com/rust-lang/rust/pull/21689
8117:      footguns and are collectively known as [opt-in built-in
8118:      traits][oibit] (though `Sync` and `Send` will soon become pure
8225:[oibit]: https://github.com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md

By the way, should we mention that the name was changed in the relnotes? Probably not, mainly because it's a nightly feature.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 25, 2020

Ah yes, that makes sense! Thanks

@bors r+

@bors
Copy link
Contributor

bors commented Nov 25, 2020

📌 Commit 82dc99b has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 25, 2020
@bors
Copy link
Contributor

bors commented Nov 25, 2020

⌛ Testing commit 82dc99b with merge ec039bd...

@camelid
Copy link
Member Author

camelid commented Nov 25, 2020

Ah yes, that makes sense!

Hmm, what do you mean? Were you referring to my suggestion that we mention this in the release notes?

@oli-obk
Copy link
Contributor

oli-obk commented Nov 25, 2020

Sorry, I responded to what I thought was the general statement you made

Should I change the name that the RFC is referenced by in the error codes?

No, let's not change history 😆

I feel like it might be confusing to see them called "auto traits" everywhere else, even though the RFC is called OIBIT. Maybe call it OIBIT, but mention that it's now called auto traits?

You do mention that on the feature gate docs, so I think that's fine. We have lots of RFCs that don't make sense by their name anymore and that is fine.

@bors
Copy link
Contributor

bors commented Nov 25, 2020

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing ec039bd to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 25, 2020
@bors bors merged commit ec039bd into rust-lang:master Nov 25, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 25, 2020
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #79336!

Tested on commit ec039bd.
Direct link to PR: #79336

💔 rls on windows: test-pass → build-fail (cc @Xanewok).
💔 rls on linux: test-pass → build-fail (cc @Xanewok).
💔 rustfmt on windows: test-pass → build-fail (cc @topecongiro @calebcartwright).
💔 rustfmt on linux: test-pass → build-fail (cc @topecongiro @calebcartwright).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Nov 25, 2020
Tested on commit rust-lang/rust@ec039bd.
Direct link to PR: <rust-lang/rust#79336>

💔 rls on windows: test-pass → build-fail (cc @Xanewok).
💔 rls on linux: test-pass → build-fail (cc @Xanewok).
💔 rustfmt on windows: test-pass → build-fail (cc @topecongiro @calebcartwright).
💔 rustfmt on linux: test-pass → build-fail (cc @topecongiro @calebcartwright).
@camelid camelid deleted the rename-feature-oibit-to-auto branch November 25, 2020 19:30
@camelid
Copy link
Member Author

camelid commented Nov 25, 2020

Okay, thanks for the explanation!

jyn514 pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Nov 27, 2020
How to remove them and how to rename them.

cc <rust-lang/rust#79336 (comment)>
cc @varkor
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Nov 27, 2020
… r=oli-obk

Rename `optin_builtin_traits` to `auto_traits`

They were originally called "opt-in, built-in traits" (OIBITs), but
people realized that the name was too confusing and a mouthful, and so
they were renamed to just "auto traits". The feature flag's name wasn't
updated, though, so that's what this PR does.

There are some other spots in the compiler that still refer to OIBITs,
but I don't think changing those now is worth it since they are internal
and not particularly relevant to this PR.

Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.

r? `@oli-obk` (feel free to re-assign if you're not the right reviewer for this)
bors added a commit to rust-lang/cargo that referenced this pull request Nov 29, 2020
Fix custom_target_dependency test.

The feature was renamed in rust-lang/rust#79336
ehuss pushed a commit to ehuss/cargo that referenced this pull request Nov 30, 2020
Fix custom_target_dependency test.

The feature was renamed in rust-lang/rust#79336
andersk added a commit to andersk/rust-gc that referenced this pull request Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-system Area: Trait system merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants