Skip to content

Rollup of 10 pull requests #87509

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

Merged
merged 22 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8ea5362
Avoid ICE on type error recovery
estebank Jun 30, 2021
9792179
Add flag to configure `large_assignments` lint
tmiasko Jun 19, 2021
b07d175
Disable glibc tests on vxworks
NicholasBaron Jul 20, 2021
7a9dd00
VxWorks does provide sigemptyset and sigaddset
NicholasBaron Jul 20, 2021
3b9f811
get rid of NoMirFor error variant
RalfJung Jul 24, 2021
5407b42
macos current_exe using directly libc instead.
devnexen Jul 25, 2021
cccd4e2
fix typo: whenver -> whenever
midgleyc Jul 26, 2021
b21024f
Add long explanation for E0544.
midgleyc Jul 26, 2021
a397fdc
Remove ASCII fast path from rustc_lexer::{is_id_continue, is_id_start}
ibraheemdev Jul 27, 2021
de27d68
update unicode-xid dependency
ibraheemdev Jul 27, 2021
38663c0
Update cargo
ehuss Jul 27, 2021
07727c8
Update books
ehuss Jul 27, 2021
99a6474
Rollup merge of #86450 - tmiasko:move-size-limit, r=pnkfelix
JohnTitor Jul 27, 2021
4e1ebf2
Rollup merge of #86764 - estebank:issue-86756, r=pnkfelix
JohnTitor Jul 27, 2021
90f6d7b
Rollup merge of #87354 - Wind-River:2021_master, r=kennytm
JohnTitor Jul 27, 2021
d254394
Rollup merge of #87427 - RalfJung:no-mir-for, r=oli-obk
JohnTitor Jul 27, 2021
988f617
Rollup merge of #87446 - devnexen:macos_update, r=dtolnay
JohnTitor Jul 27, 2021
7282d71
Rollup merge of #87494 - midgleyc:comment-typos, r=joshtriplett
JohnTitor Jul 27, 2021
a981cff
Rollup merge of #87497 - midgleyc:long-E0544, r=GuillaumeGomez
JohnTitor Jul 27, 2021
54367b9
Rollup merge of #87499 - ibraheemdev:patch-6, r=dtolnay
JohnTitor Jul 27, 2021
bea8af9
Rollup merge of #87502 - ehuss:update-cargo, r=ehuss
JohnTitor Jul 27, 2021
af6c95f
Rollup merge of #87503 - ehuss:update-books, r=ehuss
JohnTitor Jul 27, 2021
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
1 change: 1 addition & 0 deletions compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ fn test_debugging_options_tracking_hash() {
tracked!(merge_functions, Some(MergeFunctions::Disabled));
tracked!(mir_emit_retag, true);
tracked!(mir_opt_level, Some(4));
tracked!(move_size_limit, Some(4096));
tracked!(mutable_noalias, Some(true));
tracked!(new_llvm_pass_manager, Some(true));
tracked!(no_generate_arange_section, true);
Expand Down
7 changes: 6 additions & 1 deletion compiler/rustc_middle/src/middle/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ use std::num::IntErrorKind;
pub fn provide(providers: &mut ty::query::Providers) {
providers.limits = |tcx, ()| Limits {
recursion_limit: get_recursion_limit(tcx.hir().krate_attrs(), tcx.sess),
move_size_limit: get_limit(tcx.hir().krate_attrs(), tcx.sess, sym::move_size_limit, 0),
move_size_limit: get_limit(
tcx.hir().krate_attrs(),
tcx.sess,
sym::move_size_limit,
tcx.sess.opts.debugging_opts.move_size_limit.unwrap_or(0),
),
type_length_limit: get_limit(
tcx.hir().krate_attrs(),
tcx.sess,
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,8 @@ options! {
(default: no)"),
mir_opt_level: Option<usize> = (None, parse_opt_number, [TRACKED],
"MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)"),
move_size_limit: Option<usize> = (None, parse_opt_number, [TRACKED],
"the size at which the `large_assignments` lint starts to be emitted"),
mutable_noalias: Option<bool> = (None, parse_opt_bool, [TRACKED],
"emit noalias metadata for mutable references (default: yes for LLVM >= 12, otherwise no)"),
new_llvm_pass_manager: Option<bool> = (None, parse_opt_bool, [TRACKED],
Expand Down
10 changes: 10 additions & 0 deletions src/doc/unstable-book/src/compiler-flags/move-size-limit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# `move_size_limit`

--------------------

The `-Zmove-size-limit=N` compiler flag enables `large_assignments` lints which
will warn when moving objects whose size exceeds `N` bytes.

Lint warns only about moves in functions that participate in code generation.
Consequently it will be ineffective for compiler invocatation that emit
metadata only, i.e., `cargo check` like workflows.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: moving 10024 bytes
--> $DIR/large_moves.rs:10:13
--> $DIR/large_moves.rs:12:13
|
LL | let x = async {
| _____________^
Expand All @@ -17,19 +17,19 @@ LL | #![deny(large_assignments)]
| ^^^^^^^^^^^^^^^^^

error: moving 10024 bytes
--> $DIR/large_moves.rs:16:14
--> $DIR/large_moves.rs:18:14
|
LL | let z = (x, 42);
| ^ value moved from here

error: moving 10024 bytes
--> $DIR/large_moves.rs:16:13
--> $DIR/large_moves.rs:18:13
|
LL | let z = (x, 42);
| ^^^^^^^ value moved from here

error: moving 10024 bytes
--> $DIR/large_moves.rs:18:13
--> $DIR/large_moves.rs:20:13
|
LL | let a = z.0;
| ^^^ value moved from here
Expand Down
38 changes: 38 additions & 0 deletions src/test/ui/async-await/large_moves.option.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
error: moving 10024 bytes
--> $DIR/large_moves.rs:12:13
|
LL | let x = async {
| _____________^
LL | | let y = [0; 9999];
LL | | dbg!(y);
LL | | thing(&y).await;
LL | | dbg!(y);
LL | | };
| |_____^ value moved from here
|
note: the lint level is defined here
--> $DIR/large_moves.rs:1:9
|
LL | #![deny(large_assignments)]
| ^^^^^^^^^^^^^^^^^

error: moving 10024 bytes
--> $DIR/large_moves.rs:18:14
|
LL | let z = (x, 42);
| ^ value moved from here

error: moving 10024 bytes
--> $DIR/large_moves.rs:18:13
|
LL | let z = (x, 42);
| ^^^^^^^ value moved from here

error: moving 10024 bytes
--> $DIR/large_moves.rs:20:13
|
LL | let a = z.0;
| ^^^ value moved from here

error: aborting due to 4 previous errors

4 changes: 3 additions & 1 deletion src/test/ui/async-await/large_moves.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#![deny(large_assignments)]
#![feature(large_assignments)]
#![move_size_limit = "1000"]
#![cfg_attr(attribute, move_size_limit = "1000")]
// build-fail
// only-x86_64
// revisions: attribute option
// [option]compile-flags: -Zmove-size-limit=1000

// edition:2018

Expand Down