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

Rollup of 9 pull requests #110458

Merged
merged 23 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d0468a2
rm var_span_label to var_subdiag & eager subdiag
AndyJado Feb 10, 2023
bdf0e74
migrate ftl msg accroding to #103042
AndyJado Feb 24, 2023
8df1f41
fix false positives for `unused_parens` around unary and binary opera…
Apr 12, 2023
0d0949d
emit `unused_parens` for `break` if it is not immediately followed by…
Apr 12, 2023
b59ec16
allow `repr(align = x)` on inherent methods
fee1-dead Apr 14, 2023
7a07c74
Correct default value for default-linker-libraries
iterion Apr 14, 2023
32f6e7a
Remove `EnumTypeTraversalImpl`.
nnethercote Apr 16, 2023
d2b5a64
Simplify `CloneLiftImpls` and `TrivialTypeTraversalImpls`.
nnethercote Apr 16, 2023
dda8994
Allow all associated functions and add test
fee1-dead Apr 16, 2023
c98895d
Various minor Idx-related tweaks
scottmcm Apr 16, 2023
e28e190
Check freeze with right param-env
compiler-errors Apr 16, 2023
1ee189c
Encode def span for ConstParam
compiler-errors Apr 16, 2023
84de041
add test for invalid places of repr align
fee1-dead Apr 17, 2023
bef3502
tests: adapt for LLVM change 5b386b864c7619897c51a1da97d78f1cf6f3eff6
durin42 Apr 17, 2023
91fe117
Rollup merge of #104055 - AndyJado:bck_errors, r=davidtwco
matthiaskrgr Apr 17, 2023
06d12f6
Rollup merge of #110257 - lukas-code:why-would-anyone-write-code-like…
matthiaskrgr Apr 17, 2023
eb05246
Rollup merge of #110313 - fee1-dead-contrib:repr_align_method, r=Waff…
matthiaskrgr Apr 17, 2023
a785328
Rollup merge of #110337 - iterion:patch-1, r=jyn514
matthiaskrgr Apr 17, 2023
a6c1fa5
Rollup merge of #110386 - nnethercote:clean-up-traversal-macros, r=lcnr
matthiaskrgr Apr 17, 2023
0790996
Rollup merge of #110394 - scottmcm:less-idx-new, r=WaffleLapkin
matthiaskrgr Apr 17, 2023
d01c62b
Rollup merge of #110425 - compiler-errors:def-span-for-ct-param, r=pe…
matthiaskrgr Apr 17, 2023
a76b157
Rollup merge of #110434 - compiler-errors:issue-110171, r=oli-obk
matthiaskrgr Apr 17, 2023
c81e8b8
Rollup merge of #110455 - durin42:tls-D148269-fix, r=nikic
matthiaskrgr Apr 17, 2023
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
7 changes: 3 additions & 4 deletions compiler/rustc_abi/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ pub trait LayoutCalculator {
let all_indices = variants.indices();
let needs_disc =
|index: VariantIdx| index != largest_variant_index && !absent(&variants[index]);
let niche_variants = all_indices.clone().find(|v| needs_disc(*v)).unwrap().index()
..=all_indices.rev().find(|v| needs_disc(*v)).unwrap().index();
let niche_variants = all_indices.clone().find(|v| needs_disc(*v)).unwrap()
..=all_indices.rev().find(|v| needs_disc(*v)).unwrap();

let count = niche_variants.size_hint().1.unwrap() as u128;

Expand Down Expand Up @@ -560,8 +560,7 @@ pub trait LayoutCalculator {
tag: niche_scalar,
tag_encoding: TagEncoding::Niche {
untagged_variant: largest_variant_index,
niche_variants: (VariantIdx::new(*niche_variants.start())
..=VariantIdx::new(*niche_variants.end())),
niche_variants,
niche_start,
},
tag_field: 0,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use bitflags::bitflags;
use rustc_data_structures::intern::Interned;
#[cfg(feature = "nightly")]
use rustc_data_structures::stable_hasher::StableOrd;
use rustc_index::vec::{Idx, IndexSlice, IndexVec};
use rustc_index::vec::{IndexSlice, IndexVec};
#[cfg(feature = "nightly")]
use rustc_macros::HashStable_Generic;
#[cfg(feature = "nightly")]
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_ast/src/node_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ rustc_index::newtype_index! {
///
/// [`DefId`]: rustc_span::def_id::DefId
#[debug_format = "NodeId({})"]
pub struct NodeId {}
pub struct NodeId {
/// The [`NodeId`] used to represent the root of the crate.
const CRATE_NODE_ID = 0;
}
}

rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeMapEntry, NodeId);

/// The [`NodeId`] used to represent the root of the crate.
pub const CRATE_NODE_ID: NodeId = NodeId::from_u32(0);

/// When parsing and at the beginning of doing expansions, we initially give all AST nodes
/// this dummy AST [`NodeId`]. Then, during a later phase of expansion, we renumber them
/// to have small, positive IDs.
Expand Down
150 changes: 138 additions & 12 deletions compiler/rustc_borrowck/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,6 @@ borrowck_returned_lifetime_short =
borrowck_used_impl_require_static =
the used `impl` has a `'static` requirement
borrowck_capture_kind_label =
capture is {$kind_desc} because of use here
borrowck_var_borrow_by_use_place_in_generator =
borrow occurs due to use of {$place} in closure in generator
borrowck_var_borrow_by_use_place_in_closure =
borrow occurs due to use of {$place} in closure
borrowck_var_borrow_by_use_place =
borrow occurs due to use of {$place}
borrowck_borrow_due_to_use_generator =
borrow occurs due to use in generator
Expand Down Expand Up @@ -101,12 +89,63 @@ borrowck_capture_mut =
borrowck_capture_move =
capture is moved because of use here
borrowck_var_borrow_by_use_place_in_generator =
{$is_single_var ->
*[true] borrow occurs
[false] borrows occur
} due to use of {$place} in generator
borrowck_var_borrow_by_use_place_in_closure =
{$is_single_var ->
*[true] borrow occurs
[false] borrows occur
} due to use of {$place} in closure
borrowck_var_borrow_by_use_in_generator =
borrow occurs due to use in generator
borrowck_var_borrow_by_use_in_closure =
borrow occurs due to use in closure
borrowck_var_move_by_use_place_in_generator =
move occurs due to use of {$place} in generator
borrowck_var_move_by_use_place_in_closure =
move occurs due to use of {$place} in closure
borrowck_var_move_by_use_in_generator =
move occurs due to use in generator
borrowck_var_move_by_use_in_closure =
move occurs due to use in closure
borrowck_partial_var_move_by_use_in_generator =
variable {$is_partial ->
[true] partially moved
*[false] moved
} due to use in generator
borrowck_partial_var_move_by_use_in_closure =
variable {$is_partial ->
[true] partially moved
*[false] moved
} due to use in closure
borrowck_var_first_borrow_by_use_place_in_generator =
first borrow occurs due to use of {$place} in generator
borrowck_var_first_borrow_by_use_place_in_closure =
first borrow occurs due to use of {$place} in closure
borrowck_var_second_borrow_by_use_place_in_generator =
second borrow occurs due to use of {$place} in generator
borrowck_var_second_borrow_by_use_place_in_closure =
second borrow occurs due to use of {$place} in closure
borrowck_var_mutable_borrow_by_use_place_in_closure =
mutable borrow occurs due to use of {$place} in closure
borrowck_cannot_move_when_borrowed =
cannot move out of {$place ->
[value] value
Expand All @@ -127,3 +166,90 @@ borrowck_opaque_type_non_generic_param =
[true] cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type
*[other] this generic parameter must be used with a generic {$kind} parameter
}
borrowck_moved_due_to_call =
{$place_name} {$is_partial ->
[true] partially moved
*[false] moved
} due to this {$is_loop_message ->
[true] call, in previous iteration of loop
*[false] call
}
borrowck_moved_due_to_usage_in_operator =
{$place_name} {$is_partial ->
[true] partially moved
*[false] moved
} due to usage in {$is_loop_message ->
[true] operator, in previous iteration of loop
*[false] operator
}
borrowck_moved_due_to_implicit_into_iter_call =
{$place_name} {$is_partial ->
[true] partially moved
*[false] moved
} due to this implicit call to {$is_loop_message ->
[true] `.into_iter()`, in previous iteration of loop
*[false] `.into_iter()`
}
borrowck_moved_due_to_method_call =
{$place_name} {$is_partial ->
[true] partially moved
*[false] moved
} due to this method {$is_loop_message ->
[true] call, in previous iteration of loop
*[false] call
}
borrowck_value_moved_here =
value {$is_partial ->
[true] partially moved
*[false] moved
} {$is_move_msg ->
[true] into closure here
*[false] here
}{$is_loop_message ->
[true] , in previous iteration of loop
*[false] {""}
}
borrowck_consider_borrow_type_contents =
help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents
borrowck_moved_a_fn_once_in_call =
this value implements `FnOnce`, which causes it to be moved when called
borrowck_calling_operator_moves_lhs =
calling this operator moves the left-hand side
borrowck_func_take_self_moved_place =
`{$func}` takes ownership of the receiver `self`, which moves {$place_name}
borrowck_suggest_iterate_over_slice =
consider iterating over a slice of the `{$ty}`'s content to avoid moving into the `for` loop
borrowck_suggest_create_freash_reborrow =
consider reborrowing the `Pin` instead of moving it
borrowck_value_capture_here =
value captured {$is_within ->
[true] here by generator
*[false] here
}
borrowck_move_out_place_here =
{$place} is moved here
borrowck_closure_invoked_twice =
closure cannot be invoked more than once because it moves the variable `{$place_name}` out of its environment
borrowck_closure_moved_twice =
closure cannot be moved more than once as it is not `Copy` due to moving the variable `{$place_name}` out of its environment
borrowck_ty_no_impl_copy =
{$is_partial_move ->
[true] partial move
*[false] move
} occurs because {$place} has type `{$ty}`, which does not implement the `Copy` trait
Loading