forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#102297 - fee1-dead-contrib:rollup-2np0cre, r=…
…fee1-dead Rollup of 5 pull requests Successful merges: - rust-lang#102143 (Recover from struct nested in struct) - rust-lang#102178 (bootstrap: the backtrace feature is stable, no need to allow it any more) - rust-lang#102197 (Stabilize const `BTree{Map,Set}::new`) - rust-lang#102267 (Don't set RUSTC in the bootstrap build script) - rust-lang#102270 (Remove benches from `rustc_middle`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
14 changed files
with
60 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,7 @@ | ||
use env::consts::{EXE_EXTENSION, EXE_SUFFIX}; | ||
use std::env; | ||
use std::ffi::OsString; | ||
use std::path::PathBuf; | ||
|
||
/// Given an executable called `name`, return the filename for the | ||
/// executable for a particular target. | ||
pub fn exe(name: &PathBuf) -> PathBuf { | ||
if EXE_EXTENSION != "" && name.extension() != Some(EXE_EXTENSION.as_ref()) { | ||
let mut name: OsString = name.clone().into(); | ||
name.push(EXE_SUFFIX); | ||
name.into() | ||
} else { | ||
name.clone() | ||
} | ||
} | ||
|
||
fn main() { | ||
let host = env::var("HOST").unwrap(); | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
println!("cargo:rerun-if-env-changed=RUSTC"); | ||
println!("cargo:rustc-env=BUILD_TRIPLE={}", host); | ||
|
||
// This may not be a canonicalized path. | ||
let mut rustc = PathBuf::from(env::var_os("RUSTC").unwrap()); | ||
|
||
if rustc.is_relative() { | ||
println!("cargo:rerun-if-env-changed=PATH"); | ||
for dir in env::split_paths(&env::var_os("PATH").unwrap_or_default()) { | ||
let absolute = dir.join(&exe(&rustc)); | ||
if absolute.exists() { | ||
rustc = absolute; | ||
break; | ||
} | ||
} | ||
} | ||
assert!(rustc.is_absolute()); | ||
|
||
// FIXME: if the path is not utf-8, this is going to break. Unfortunately | ||
// Cargo doesn't have a way for us to specify non-utf-8 paths easily, so | ||
// we'll need to invent some encoding scheme if this becomes a problem. | ||
println!("cargo:rustc-env=RUSTC={}", rustc.to_str().unwrap()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
struct S1 { | ||
struct S2 { | ||
//~^ ERROR structs are not allowed in struct definitions | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: structs are not allowed in struct definitions | ||
--> $DIR/issue-101540.rs:2:5 | ||
| | ||
LL | struct S2 { | ||
| ^^^^^^^^^ | ||
| | ||
= help: consider creating a new `struct` definition instead of nesting | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters