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

5 little typos #110441

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion compiler/rustc_lint/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ lint_builtin_incomplete_features = the feature `{$name}` is incomplete and may n
.help = consider using `min_{$name}` instead, which is more stable and complete

lint_builtin_unpermitted_type_init_zeroed = the type `{$ty}` does not permit zero-initialization
lint_builtin_unpermitted_type_init_unint = the type `{$ty}` does not permit being left uninitialized
lint_builtin_unpermitted_type_init_uninit = the type `{$ty}` does not permit being left uninitialized

lint_builtin_unpermitted_type_init_label = this code causes undefined behavior when executed
lint_builtin_unpermitted_type_init_label_suggestion = help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2628,7 +2628,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
if let Some(err) = with_no_trimmed_paths!(ty_find_init_error(cx, conjured_ty, init)) {
let msg = match init {
InitKind::Zeroed => fluent::lint_builtin_unpermitted_type_init_zeroed,
InitKind::Uninit => fluent::lint_builtin_unpermitted_type_init_unint,
InitKind::Uninit => fluent::lint_builtin_unpermitted_type_init_uninit,
};
let sub = BuiltinUnpermittedTypeInitSub { err };
cx.emit_spanned_lint(
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ impl<T: ?Sized> *const T {
/// ```
#[unstable(feature = "ptr_to_from_bits", issue = "91126")]
#[deprecated(
since = "1.67",
note = "replaced by the `exposed_addr` method, or update your code \
since = "1.67.0",
Copy link
Member

@Noratrieb Noratrieb Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, was this not set to CURRENT_RUSTC_VERSION and automatically changed in the release 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No (#95583)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @scottmcm :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, oops 🙃

TBH, these methods should just be deleted now. The new strict-provenance-related ones are the way forward.

note = "replaced by the `expose_addr` method, or update your code \
to follow the strict provenance rules using its APIs"
)]
#[inline(always)]
Expand Down Expand Up @@ -161,7 +161,7 @@ impl<T: ?Sized> *const T {
/// ```
#[unstable(feature = "ptr_to_from_bits", issue = "91126")]
#[deprecated(
since = "1.67",
since = "1.67.0",
note = "replaced by the `ptr::from_exposed_addr` function, or update \
your code to follow the strict provenance rules using its APIs"
)]
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ impl<T: ?Sized> *mut T {
/// ```
#[unstable(feature = "ptr_to_from_bits", issue = "91126")]
#[deprecated(
since = "1.67",
note = "replaced by the `exposed_addr` method, or update your code \
since = "1.67.0",
note = "replaced by the `expose_addr` method, or update your code \
to follow the strict provenance rules using its APIs"
)]
#[inline(always)]
Expand Down Expand Up @@ -167,7 +167,7 @@ impl<T: ?Sized> *mut T {
/// ```
#[unstable(feature = "ptr_to_from_bits", issue = "91126")]
#[deprecated(
since = "1.67",
since = "1.67.0",
note = "replaced by the `ptr::from_exposed_addr_mut` function, or \
update your code to follow the strict provenance rules using its APIs"
)]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/optimize-attr-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// CHECK-LABEL: define{{.*}}i32 @nothing
// CHECK-SAME: [[NOTHING_ATTRS:#[0-9]+]]
// SIZE-OPT: ret i32 4
// SPEEC-OPT: ret i32 4
// SPEED-OPT: ret i32 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice catch, since this was just a nop with the typo.

#[no_mangle]
pub fn nothing() -> i32 {
2 + 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-block-unint.rs:4:11
--> $DIR/borrowck-block-uninit.rs:4:11
|
LL | let x: isize;
| - binding declared here but left uninitialized
Expand Down