Skip to content

Commit 05dc5e7

Browse files
committed
Auto merge of #50119 - kennytm:rollup, r=kennytm
Rollup of 7 pull requests Successful merges: - #50031 (Clarified E0015 message.) - #50058 (Added build disk usage information) - #50081 (Update stdsimd submodule) - #50083 (wasm: Increase default stack size to 1MB) - #50104 (Disable auto-detection of libxml2 when compiling llvm.) - #50114 (Fix bad merge in #49991) - #50117 (must explicitly request file name when using with_file_name.) Failed merges:
2 parents 6586074 + 53232e5 commit 05dc5e7

File tree

12 files changed

+50
-11
lines changed

12 files changed

+50
-11
lines changed

CONTRIBUTING.md

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ file. If you still have a `config.mk` file in your directory - from
136136
### Building
137137
[building]: #building
138138

139+
A default configuration shall use around 3.5 GB of disk space, whereas building a debug configuration may require more than 30 GB.
140+
139141
Dependencies
140142
- [build dependencies](README.md#building-from-source)
141143
- `gdb` 6.2.0 minimum, 7.1 or later recommended for test builds

src/bootstrap/native.rs

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ impl Step for Llvm {
149149
.define("WITH_POLLY", "OFF")
150150
.define("LLVM_ENABLE_TERMINFO", "OFF")
151151
.define("LLVM_ENABLE_LIBEDIT", "OFF")
152+
.define("LLVM_ENABLE_LIBXML2", "OFF")
152153
.define("LLVM_PARALLEL_COMPILE_JOBS", builder.jobs().to_string())
153154
.define("LLVM_TARGET_ARCH", target.split('-').next().unwrap())
154155
.define("LLVM_DEFAULT_TARGET_TRIPLE", target);

src/librustc_metadata/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
930930
} else if let hir::ImplItemKind::Method(ref sig, _) = ast_item.node {
931931
let generics = self.tcx.generics_of(def_id);
932932
let types = generics.parent_types as usize + generics.types.len();
933-
let needs_inline = types > 0 || tcx.trans_fn_attrs(def_id).requests_inline() &&
933+
let needs_inline = (types > 0 || tcx.trans_fn_attrs(def_id).requests_inline()) &&
934934
!self.metadata_output_only();
935935
let is_const_fn = sig.constness == hir::Constness::Const;
936936
let always_encode_mir = self.tcx.sess.opts.debugging_opts.always_encode_mir;

src/librustc_mir/transform/qualify_consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -964,15 +964,15 @@ This does not pose a problem by itself because they can't be accessed directly."
964964
let (msg, note) = if let UnstableFeatures::Disallow =
965965
self.tcx.sess.opts.unstable_features {
966966
(format!("calls in {}s are limited to \
967-
struct and enum constructors",
967+
tuple structs and tuple variants",
968968
self.mode),
969969
Some("a limited form of compile-time function \
970970
evaluation is available on a nightly \
971971
compiler via `const fn`"))
972972
} else {
973973
(format!("calls in {}s are limited \
974974
to constant functions, \
975-
struct and enum constructors",
975+
tuple structs and tuple variants",
976976
self.mode),
977977
None)
978978
};

src/librustc_trans/back/linker.rs

+1
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ impl Linker for WasmLd {
960960

961961
fn finalize(&mut self) -> Command {
962962
self.cmd.arg("--threads");
963+
self.cmd.arg("-z").arg("stack-size=1048576");
963964

964965
// FIXME we probably shouldn't pass this but instead pass an explicit
965966
// whitelist of symbols we'll allow to be undefined. Unfortunately

src/stdsimd

src/test/compile-fail/issue-43105.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
fn xyz() -> u8 { 42 }
1212

1313
const NUM: u8 = xyz();
14-
//~^ ERROR calls in constants are limited to constant functions, struct and enum constructors
14+
//~^ ERROR calls in constants are limited to constant functions, tuple structs and tuple variants
1515
//~| ERROR constant evaluation error
1616

1717
fn main() {

src/test/compile-fail/issue32829.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
11+
// ignore-tidy-linelength
12+
1013
#![feature(const_fn)]
1114

1215
const bad : u32 = {
@@ -20,7 +23,7 @@ const bad_two : u32 = {
2023
{
2124
invalid();
2225
//~^ ERROR: blocks in constants are limited to items and tail expressions
23-
//~^^ ERROR: calls in constants are limited to constant functions, struct and enum
26+
//~^^ ERROR: calls in constants are limited to constant functions, tuple structs and tuple variants
2427
0
2528
}
2629
};
@@ -44,7 +47,7 @@ static bad_five : u32 = {
4447
{
4548
invalid();
4649
//~^ ERROR: blocks in statics are limited to items and tail expressions
47-
//~^^ ERROR: calls in statics are limited to constant functions, struct and enum
50+
//~^^ ERROR: calls in statics are limited to constant functions, tuple structs and tuple variants
4851
0
4952
}
5053
};
@@ -68,7 +71,7 @@ static mut bad_eight : u32 = {
6871
{
6972
invalid();
7073
//~^ ERROR: blocks in statics are limited to items and tail expressions
71-
//~^^ ERROR: calls in statics are limited to constant functions, struct and enum
74+
//~^^ ERROR: calls in statics are limited to constant functions, tuple structs and tuple variants
7275
0
7376
}
7477
};

src/test/ui/const-fn-error.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0016]: blocks in constant functions are limited to items and tail express
44
LL | let mut sum = 0;
55
| ^
66

7-
error[E0015]: calls in constant functions are limited to constant functions, struct and enum constructors
7+
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
88
--> $DIR/const-fn-error.rs:18:14
99
|
1010
LL | for i in 0..x {

src/test/ui/mir_check_nonconst.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![allow(dead_code)]
12+
13+
struct Foo { a: u8 }
14+
fn bar() -> Foo {
15+
Foo { a: 5 }
16+
}
17+
18+
static foo: Foo = bar();
19+
//~^ ERROR calls in statics are limited to constant functions, tuple structs and tuple variants
20+
21+
fn main() {}

src/test/ui/mir_check_nonconst.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
2+
--> $DIR/mir_check_nonconst.rs:18:19
3+
|
4+
LL | static foo: Foo = bar();
5+
| ^^^^^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0015`.

src/tools/compiletest/src/runtest.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2880,8 +2880,10 @@ impl<'test> TestCx<'test> {
28802880
}
28812881
}
28822882

2883-
let expected_output_path = self.expected_output_path(kind);
2884-
let output_file = self.output_base_name().with_file_name(&expected_output_path);
2883+
let expected_output = self.expected_output_path(kind);
2884+
// #50113: output is abspath; only want filename component.
2885+
let expected_output = expected_output.file_name().expect("output path requires file name");
2886+
let output_file = self.output_base_name().with_file_name(&expected_output);
28852887
match File::create(&output_file).and_then(|mut f| f.write_all(actual.as_bytes())) {
28862888
Ok(()) => {}
28872889
Err(e) => self.fatal(&format!(

0 commit comments

Comments
 (0)