Skip to content

Commit 3712e11

Browse files
committed
Auto merge of #71059 - Dylan-DPC:rollup-zgu6jmx, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #71029 (Partial work on building with Cargo) - #71034 (Clean up E0515 explanation) - #71041 (Update links of `rustc guide`) - #71048 (Normalize source when loading external foreign source into SourceMap) - #71053 (Add some basic docs to `sym` and `kw` modules) - #71057 (Clean up E0516 explanation) Failed merges: r? @ghost
2 parents 4d1fbac + e684630 commit 3712e11

File tree

25 files changed

+118
-40
lines changed

25 files changed

+118
-40
lines changed

Cargo.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3694,6 +3694,7 @@ dependencies = [
36943694
"indexmap",
36953695
"jobserver",
36963696
"lazy_static 1.4.0",
3697+
"libc",
36973698
"log",
36983699
"measureme",
36993700
"parking_lot 0.10.0",
@@ -3713,6 +3714,7 @@ version = "0.0.0"
37133714
dependencies = [
37143715
"env_logger 0.7.1",
37153716
"lazy_static 1.4.0",
3717+
"libc",
37163718
"log",
37173719
"rustc_ast",
37183720
"rustc_ast_pretty",
@@ -3867,6 +3869,7 @@ dependencies = [
38673869
name = "rustc_interface"
38683870
version = "0.0.0"
38693871
dependencies = [
3872+
"libc",
38703873
"log",
38713874
"once_cell",
38723875
"rustc-rayon",
@@ -3960,6 +3963,7 @@ name = "rustc_metadata"
39603963
version = "0.0.0"
39613964
dependencies = [
39623965
"flate2",
3966+
"libc",
39633967
"log",
39643968
"memmap",
39653969
"rustc_ast",
@@ -4197,6 +4201,7 @@ dependencies = [
41974201
name = "rustc_session"
41984202
version = "0.0.0"
41994203
dependencies = [
4204+
"getopts",
42004205
"log",
42014206
"num_cpus",
42024207
"rustc_ast",

src/bootstrap/compile.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ pub fn std_cargo(builder: &Builder<'_>, target: Interned<String>, cargo: &mut Ca
186186
// `compiler-rt` is located.
187187
let compiler_builtins_root = builder.src.join("src/llvm-project/compiler-rt");
188188
let compiler_builtins_c_feature = if compiler_builtins_root.exists() {
189+
// Note that `libprofiler_builtins/build.rs` also computes this so if
190+
// you're changing something here please also change that.
189191
cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
190192
" compiler-builtins-c".to_string()
191193
} else {

src/libprofiler_builtins/build.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ fn main() {
6363
cfg.define("COMPILER_RT_HAS_ATOMICS", Some("1"));
6464
}
6565

66-
let root = env::var_os("RUST_COMPILER_RT_ROOT").unwrap();
67-
let root = Path::new(&root);
66+
// Note that this should exist if we're going to run (otherwise we just
67+
// don't build profiler builtins at all).
68+
let root = Path::new("../llvm-project/compiler-rt");
6869

6970
let src_root = root.join("lib").join("profile");
7071
for src in profile_sources {

src/librustc_data_structures/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2727
rustc_index = { path = "../librustc_index", package = "rustc_index" }
2828
bitflags = "1.2.1"
2929
measureme = "0.7.1"
30+
libc = "0.2"
3031

3132
[dependencies.parking_lot]
3233
version = "0.10"

src/librustc_data_structures/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
#[macro_use]
2828
extern crate log;
29-
#[cfg(unix)]
30-
extern crate libc;
3129
#[macro_use]
3230
extern crate cfg_if;
3331

src/librustc_driver/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ crate-type = ["dylib"]
1111

1212
[dependencies]
1313
lazy_static = "1.0"
14+
libc = "0.2"
1415
log = "0.4"
1516
env_logger = { version = "0.7", default-features = false }
1617
rustc_middle = { path = "../librustc_middle" }

src/librustc_driver/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
#![feature(nll)]
99
#![recursion_limit = "256"]
1010

11-
pub extern crate getopts;
12-
#[cfg(unix)]
13-
extern crate libc;
1411
#[macro_use]
1512
extern crate log;
1613
#[macro_use]
@@ -37,6 +34,7 @@ use rustc_save_analysis::DumpHandler;
3734
use rustc_serialize::json::{self, ToJson};
3835
use rustc_session::config::nightly_options;
3936
use rustc_session::config::{ErrorOutputType, Input, OutputType, PrintRequest};
37+
use rustc_session::getopts;
4038
use rustc_session::lint::{Lint, LintId};
4139
use rustc_session::{config, DiagnosticOutput, Session};
4240
use rustc_session::{early_error, early_warn};

src/librustc_error_codes/error_codes/E0515.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
Cannot return value that references local variable
2-
3-
Local variables, function parameters and temporaries are all dropped before the
4-
end of the function body. So a reference to them cannot be returned.
1+
A reference to a local variable was returned.
52

63
Erroneous code example:
74

@@ -20,6 +17,9 @@ fn get_dangling_iterator<'a>() -> Iter<'a, i32> {
2017
}
2118
```
2219

20+
Local variables, function parameters and temporaries are all dropped before the
21+
end of the function body. So a reference to them cannot be returned.
22+
2323
Consider returning an owned value instead:
2424

2525
```

src/librustc_error_codes/error_codes/E0516.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
The `typeof` keyword is currently reserved but unimplemented.
2+
23
Erroneous code example:
34

45
```compile_fail,E0516

src/librustc_infer/traits/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//! Trait Resolution. See the [rustc guide] for more information on how this works.
1+
//! Trait Resolution. See the [rustc-dev-guide] for more information on how this works.
22
//!
3-
//! [rustc guide]: https://rust-lang.github.io/rustc-guide/traits/resolution.html
3+
//! [rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/traits/resolution.html
44
55
mod engine;
66
pub mod error_reporting;

0 commit comments

Comments
 (0)