Skip to content
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_attr_parsing/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ attr_parsing_unstable_cfg_target_compact =
compact `cfg(target(..))` is experimental and subject to change

attr_parsing_unstable_feature_bound_incompatible_stability = item annotated with `#[unstable_feature_bound]` should not be stable
.help = If this item is meant to be stable, do not use any functions annotated with `#[unstable_feature_bound]`. Otherwise, mark this item as unstable with `#[unstable]`
.help = if this item is meant to be stable, do not use any functions annotated with `#[unstable_feature_bound]`. Otherwise, mark this item as unstable with `#[unstable]`

attr_parsing_unsupported_instruction_set = target `{$current_target}` does not support `#[instruction_set({$instruction_set}::*)]`

Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_const_eval/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ const_eval_incompatible_return_types =
const_eval_interior_mutable_borrow_escaping =
interior mutable shared borrows of temporaries that have their lifetime extended until the end of the program are not allowed
.label = this borrow of an interior mutable value refers to such a temporary
.note = Temporaries in constants and statics can have their lifetime extended until the end of the program
.note2 = To avoid accidentally creating global mutable state, such temporaries must be immutable
.help = If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
.note = temporaries in constants and statics can have their lifetime extended until the end of the program
.note2 = to avoid accidentally creating global mutable state, such temporaries must be immutable
.help = if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

const_eval_intern_kind = {$kind ->
[static] static
Expand Down Expand Up @@ -225,9 +225,9 @@ const_eval_modified_global =
const_eval_mutable_borrow_escaping =
mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
.label = this mutable borrow refers to such a temporary
.note = Temporaries in constants and statics can have their lifetime extended until the end of the program
.note2 = To avoid accidentally creating global mutable state, such temporaries must be immutable
.help = If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
.note = temporaries in constants and statics can have their lifetime extended until the end of the program
.note2 = to avoid accidentally creating global mutable state, such temporaries must be immutable
.help = if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

const_eval_mutable_ptr_in_final = encountered mutable pointer in final value of {const_eval_intern_kind}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ lint_invalid_style = {$is_used_as_inner ->
[false] crate-level attribute should be an inner attribute: add an exclamation mark: `#![{$name}]`
*[other] the `#![{$name}]` attribute can only be used at the crate root
}
.note = This attribute does not have an `!`, which means it is applied to this {$target}
.note = this attribute does not have an `!`, which means it is applied to this {$target}

lint_invalid_target = `#[{$name}]` attribute cannot be used on {$target}
.warn = {-lint_previously_accepted}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_monomorphize/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ monomorphize_encountered_error_while_instantiating_global_asm =
monomorphize_large_assignments =
moving {$size} bytes
.label = value moved from here
.note = The current maximum size is {$limit}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
.note = the current maximum size is {$limit}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`

monomorphize_no_optimized_mir =
missing optimized MIR for `{$instance}` in the crate `{$crate_name}`
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_passes/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ passes_no_main_function =
}
.consider_adding_main_to_file = consider adding a `main` function to `{$filename}`
.consider_adding_main_at_crate = consider adding a `main` function at the crate level
.teach_note = If you don't know the basics of Rust, you can go look to the Rust Book to get started: https://doc.rust-lang.org/book/
.teach_note = if you don't know the basics of Rust, you can go look to the Rust Book to get started: https://doc.rust-lang.org/book/
.non_function_main = non-function item at `crate::main` is found

passes_non_exhaustive_with_default_field_values =
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/attributes/crate-only-as-outer.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: crate-level attribute should be an inner attribute: add an exclamation ma
LL | #[crate_name = "owo"]
| ^^^^^^^^^^^^^^^^^^^^^
|
note: This attribute does not have an `!`, which means it is applied to this function
note: this attribute does not have an `!`, which means it is applied to this function
--> $DIR/crate-only-as-outer.rs:5:1
|
LL | fn main() {}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/attributes/malformed-attrs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ warning: crate-level attribute should be an inner attribute: add an exclamation
LL | #[crate_name]
| ^^^^^^^^^^^^^
|
note: This attribute does not have an `!`, which means it is applied to this function
note: this attribute does not have an `!`, which means it is applied to this function
--> $DIR/malformed-attrs.rs:116:1
|
LL | / fn test() {
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/attributes/malformed-no-std.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ error: crate-level attribute should be an inner attribute: add an exclamation ma
LL | #[no_std]
| ^^^^^^^^^
|
note: This attribute does not have an `!`, which means it is applied to this extern crate
note: this attribute does not have an `!`, which means it is applied to this extern crate
--> $DIR/malformed-no-std.rs:26:1
|
LL | extern crate core;
Expand All @@ -75,7 +75,7 @@ error: crate-level attribute should be an inner attribute: add an exclamation ma
LL | #[no_core]
| ^^^^^^^^^^
|
note: This attribute does not have an `!`, which means it is applied to this extern crate
note: this attribute does not have an `!`, which means it is applied to this extern crate
--> $DIR/malformed-no-std.rs:26:1
|
LL | extern crate core;
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/consts/const-mut-refs/issue-76510.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ error[E0764]: mutable borrows of temporaries that have their lifetime extended u
LL | const S: &'static mut str = &mut " hello ";
| ^^^^^^^^^^^^^^ this mutable borrow refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error: aborting due to 1 previous error

Expand Down
36 changes: 18 additions & 18 deletions tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ error[E0764]: mutable borrows of temporaries that have their lifetime extended u
LL | const B: *mut i32 = &mut 4;
| ^^^^^^ this mutable borrow refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
--> $DIR/mut_ref_in_final.rs:21:35
|
LL | const B3: Option<&mut i32> = Some(&mut 42);
| ^^^^^^^ this mutable borrow refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0716]: temporary value dropped while borrowed
--> $DIR/mut_ref_in_final.rs:24:42
Expand Down Expand Up @@ -86,39 +86,39 @@ error[E0764]: mutable borrows of temporaries that have their lifetime extended u
LL | static RAW_MUT_CAST_S: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
| ^^^^^^^ this mutable borrow refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
--> $DIR/mut_ref_in_final.rs:73:54
|
LL | static RAW_MUT_COERCE_S: SyncPtr<i32> = SyncPtr { x: &mut 0 };
| ^^^^^^ this mutable borrow refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
--> $DIR/mut_ref_in_final.rs:75:52
|
LL | const RAW_MUT_CAST_C: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
| ^^^^^^^ this mutable borrow refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
--> $DIR/mut_ref_in_final.rs:77:53
|
LL | const RAW_MUT_COERCE_C: SyncPtr<i32> = SyncPtr { x: &mut 0 };
| ^^^^^^ this mutable borrow refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0080]: constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
--> $DIR/mut_ref_in_final.rs:86:5
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/consts/const-promoted-opaque.atomic.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ error[E0492]: interior mutable shared borrows of temporaries that have their lif
LL | const BAZ: &Foo = &FOO;
| ^^^^ this borrow of an interior mutable value refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0716]: temporary value dropped while borrowed
--> $DIR/const-promoted-opaque.rs:40:26
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/consts/issue-17718-const-bad-values.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ error[E0764]: mutable borrows of temporaries that have their lifetime extended u
LL | const C1: &'static mut [usize] = &mut [];
| ^^^^^^^ this mutable borrow refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error: aborting due to 1 previous error

Expand Down
18 changes: 9 additions & 9 deletions tests/ui/consts/issue-17718-const-borrow.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ error[E0492]: interior mutable shared borrows of temporaries that have their lif
LL | const B: &'static UnsafeCell<usize> = &A;
| ^^ this borrow of an interior mutable value refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0492]: interior mutable shared borrows of temporaries that have their lifetime extended until the end of the program are not allowed
--> $DIR/issue-17718-const-borrow.rs:9:39
|
LL | const E: &'static UnsafeCell<usize> = &D.a;
| ^^^^ this borrow of an interior mutable value refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0492]: interior mutable shared borrows of temporaries that have their lifetime extended until the end of the program are not allowed
--> $DIR/issue-17718-const-borrow.rs:11:23
|
LL | const F: &'static C = &D;
| ^^ this borrow of an interior mutable value refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error: aborting due to 3 previous errors

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/consts/partial_qualif.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ error[E0492]: interior mutable shared borrows of temporaries that have their lif
LL | &{a}
| ^^^^ this borrow of an interior mutable value refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error: aborting due to 1 previous error

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/consts/qualif_overwrite.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ error[E0492]: interior mutable shared borrows of temporaries that have their lif
LL | &{a}
| ^^^^ this borrow of an interior mutable value refers to such a temporary
|
= note: Temporaries in constants and statics can have their lifetime extended until the end of the program
= note: To avoid accidentally creating global mutable state, such temporaries must be immutable
= help: If you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
= note: temporaries in constants and statics can have their lifetime extended until the end of the program
= note: to avoid accidentally creating global mutable state, such temporaries must be immutable
= help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error: aborting due to 1 previous error

Expand Down
Loading
Loading