Skip to content

Rollup of 7 pull requests #83934

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 14 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl<CTX> HashStable<CTX> for LazyTokenStream {
/// The goal is for procedural macros to work with `TokenStream`s and `TokenTree`s
/// instead of a representation of the abstract syntax tree.
/// Today's `TokenTree`s can still contain AST via `token::Interpolated` for
/// backwards compatability.
/// backwards compatibility.
#[derive(Clone, Debug, Default, Encodable, Decodable)]
pub struct TokenStream(pub(crate) Lrc<Vec<TreeAndSpacing>>);

Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,8 @@ the command line flag directly.
);
}

fn describe_lints(sess: &Session, lint_store: &LintStore, loaded_plugins: bool) {
/// Write to stdout lint command options, together with a list of all available lints
pub fn describe_lints(sess: &Session, lint_store: &LintStore, loaded_plugins: bool) {
println!(
"
Available lint options:
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_target/src/spec/apple_base.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::env;

use crate::spec::{LinkArgs, SplitDebuginfo, TargetOptions};
use crate::spec::{SplitDebuginfo, TargetOptions};

pub fn opts(os: &str) -> TargetOptions {
// ELF TLS is only available in macOS 10.7+. If you try to compile for 10.6
Expand All @@ -27,10 +27,8 @@ pub fn opts(os: &str) -> TargetOptions {
is_like_osx: true,
dwarf_version: Some(2),
has_rpath: true,
dll_prefix: "lib".to_string(),
dll_suffix: ".dylib".to_string(),
archive_format: "darwin".to_string(),
pre_link_args: LinkArgs::new(),
has_elf_tls: version >= (10, 7),
abi_return_struct_as_int: true,
emit_debug_gdb_scripts: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub fn target() -> Target {

options: TargetOptions {
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
unsupported_abis: super::arm_base::unsupported_abis(),
mcount: "\u{1}__gnu_mcount_nc".to_string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub fn target() -> Target {
options: TargetOptions {
// Info about features at https://wiki.debian.org/ArmHardFloatPort
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
unsupported_abis: super::arm_base::unsupported_abis(),
mcount: "\u{1}__gnu_mcount_nc".to_string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub fn target() -> Target {

options: TargetOptions {
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
unsupported_abis: super::arm_base::unsupported_abis(),
mcount: "\u{1}mcount".to_string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub fn target() -> Target {
// target.
options: TargetOptions {
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
unsupported_abis: super::arm_base::unsupported_abis(),
mcount: "\u{1}mcount".to_string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub fn target() -> Target {
options: TargetOptions {
env: "eabihf".to_string(),
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
unsupported_abis: super::arm_base::unsupported_abis(),
mcount: "__mcount".to_string(),
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_target/src/spec/armv7_wrs_vxworks_eabihf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub fn target() -> Target {
options: TargetOptions {
// Info about features at https://wiki.debian.org/ArmHardFloatPort
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
unsupported_abis: super::arm_base::unsupported_abis(),
..base
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_target/src/spec/avr_gnu_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ pub fn target(target_cpu: String) -> Target {
exe_suffix: ".elf".to_string(),

linker: Some("avr-gcc".to_owned()),
dynamic_linking: false,
executables: true,
linker_is_gnu: true,
has_rpath: false,
position_independent_executables: false,
eh_frame_header: false,
pre_link_args: vec![(LinkerFlavor::Gcc, vec![format!("-mmcu={}", target_cpu)])]
.into_iter()
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_target/src/spec/fuchsia_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ pub fn opts() -> TargetOptions {
os: "fuchsia".to_string(),
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
linker: Some("rust-lld".to_owned()),
lld_flavor: LldFlavor::Ld,
dynamic_linking: true,
executables: true,
os_family: Some("unix".to_string()),
is_like_fuchsia: true,
linker_is_gnu: true,
has_rpath: false,
pre_link_args,
pre_link_objects: crt_objects::new(&[
(LinkOutputKind::DynamicNoPicExe, &["Scrt1.o"]),
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_target/src/spec/haiku_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pub fn opts() -> TargetOptions {
os: "haiku".to_string(),
dynamic_linking: true,
executables: true,
has_rpath: false,
os_family: Some("unix".to_string()),
relro_level: RelroLevel::Full,
linker_is_gnu: true,
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_target/src/spec/hermit_base.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy};
use crate::spec::{RelocModel, TargetOptions, TlsModel};
use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy, TargetOptions, TlsModel};

pub fn opts() -> TargetOptions {
let mut pre_link_args = LinkArgs::new();
Expand All @@ -19,8 +18,6 @@ pub fn opts() -> TargetOptions {
panic_strategy: PanicStrategy::Abort,
position_independent_executables: true,
static_position_independent_executables: true,
relocation_model: RelocModel::Pic,
os_family: None,
tls_model: TlsModel::InitialExec,
..Default::default()
}
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_target/src/spec/hermit_kernel_base.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy};
use crate::spec::{RelocModel, TargetOptions, TlsModel};
use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy, TargetOptions, TlsModel};

pub fn opts() -> TargetOptions {
let mut pre_link_args = LinkArgs::new();
Expand All @@ -20,8 +19,6 @@ pub fn opts() -> TargetOptions {
panic_strategy: PanicStrategy::Abort,
position_independent_executables: true,
static_position_independent_executables: true,
relocation_model: RelocModel::Pic,
os_family: None,
tls_model: TlsModel::InitialExec,
..Default::default()
}
Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_target/src/spec/hexagon_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::spec::{LinkArgs, Target};
use crate::spec::Target;

pub fn target() -> Target {
let mut base = super::linux_musl_base::opts();
Expand All @@ -8,15 +8,11 @@ pub fn target() -> Target {
base.features = "-small-data,+hvx-length128b".to_string();

base.crt_static_default = false;
base.atomic_cas = true;
base.has_rpath = true;
base.linker_is_gnu = false;
base.dynamic_linking = true;
base.executables = true;

base.pre_link_args = LinkArgs::new();
base.post_link_args = LinkArgs::new();

Target {
llvm_target: "hexagon-unknown-linux-musl".to_string(),
pointer_width: 32,
Expand Down
7 changes: 1 addition & 6 deletions compiler/rustc_target/src/spec/l4re_base.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions};
use crate::spec::{LinkerFlavor, PanicStrategy, TargetOptions};
//use std::process::Command;

// Use GCC to locate code for crt* libraries from the host, not from L4Re. Note
Expand All @@ -13,18 +13,13 @@ use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions};
//}

pub fn opts() -> TargetOptions {
let mut args = LinkArgs::new();
args.insert(LinkerFlavor::Gcc, vec![]);

TargetOptions {
os: "l4re".to_string(),
env: "uclibc".to_string(),
linker_flavor: LinkerFlavor::Ld,
executables: true,
has_elf_tls: false,
panic_strategy: PanicStrategy::Abort,
linker: Some("ld".to_string()),
pre_link_args: args,
os_family: Some("unix".to_string()),
..Default::default()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub fn target() -> Target {
cpu: "generic-rv32".to_string(),
max_atomic_width: Some(0),
atomic_cas: false,
features: String::new(),
executables: true,
panic_strategy: PanicStrategy::Abort,
relocation_model: RelocModel::Static,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub fn target() -> Target {
linker: Some("rust-lld".to_string()),
cpu: "generic-rv32".to_string(),
max_atomic_width: Some(32),
atomic_cas: true,
features: "+m,+a,+c".to_string(),
executables: true,
panic_strategy: PanicStrategy::Abort,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub fn target() -> Target {
llvm_abiname: "lp64d".to_string(),
cpu: "generic-rv64".to_string(),
max_atomic_width: Some(64),
atomic_cas: true,
features: "+m,+a,+f,+d,+c".to_string(),
executables: true,
panic_strategy: PanicStrategy::Abort,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub fn target() -> Target {
linker: Some("rust-lld".to_string()),
cpu: "generic-rv64".to_string(),
max_atomic_width: Some(64),
atomic_cas: true,
features: "+m,+a,+c".to_string(),
executables: true,
panic_strategy: PanicStrategy::Abort,
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ pub fn target() -> Target {

main_needs_argc_argv: false,

// No thread-local storage (just use a static Cell)
has_elf_tls: false,

// don't have atomic compare-and-swap
atomic_cas: false,
has_thumb_interworking: true,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_target/src/spec/thumbv7a_pc_windows_msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub fn target() -> Target {

options: TargetOptions {
features: "+vfp3,+neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
unsupported_abis: super::arm_base::unsupported_abis(),
..base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub fn target() -> Target {
arch: "arm".to_string(),
options: TargetOptions {
features: "+vfp3,+neon".to_string(),
cpu: "generic".to_string(),
unsupported_abis: super::arm_base::unsupported_abis(),
..base
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub fn target() -> Target {
options: TargetOptions {
// Info about features at https://wiki.debian.org/ArmHardFloatPort
features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
unsupported_abis: super::arm_base::unsupported_abis(),
..base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub fn target() -> Target {
// target.
options: TargetOptions {
features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".to_string(),
cpu: "generic".to_string(),
max_atomic_width: Some(64),
unsupported_abis: super::arm_base::unsupported_abis(),
mcount: "\u{1}mcount".to_string(),
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_target/src/spec/vxworks_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub fn opts() -> TargetOptions {
os_family: Some("unix".to_string()),
linker_is_gnu: true,
has_rpath: true,
position_independent_executables: false,
has_elf_tls: true,
crt_static_default: true,
crt_static_respected: true,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_target/src/spec/wasm_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ pub fn options() -> TargetOptions {
exe_suffix: ".wasm".to_string(),
dll_prefix: String::new(),
dll_suffix: ".wasm".to_string(),
linker_is_gnu: false,
eh_frame_header: false,

max_atomic_width: Some(64),
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_target/src/spec/windows_gnu_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ pub fn opts() -> TargetOptions {
dll_prefix: String::new(),
dll_suffix: ".dll".to_string(),
exe_suffix: ".exe".to_string(),
staticlib_prefix: "lib".to_string(),
staticlib_suffix: ".a".to_string(),
os_family: Some("windows".to_string()),
is_like_windows: true,
allows_weak_linkage: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::iter;

use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
use super::{LinkerFlavor, LldFlavor, Target, TargetOptions};

pub fn target() -> Target {
const PRE_LINK_ARGS: &[&str] = &[
Expand Down Expand Up @@ -56,12 +56,10 @@ pub fn target() -> Target {
env: "sgx".into(),
vendor: "fortanix".into(),
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
dynamic_linking: false,
executables: true,
linker_is_gnu: true,
linker: Some("rust-lld".to_owned()),
max_atomic_width: Some(64),
panic_strategy: PanicStrategy::Unwind,
cpu: "x86-64".into(),
features: "+rdrnd,+rdseed,+lvi-cfi,+lvi-load-hardening".into(),
llvm_args: vec!["--x86-experimental-lvi-inline-asm-hardening".into()],
Expand Down
14 changes: 8 additions & 6 deletions src/etc/lldb_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,20 +527,22 @@ def get_child_at_index(self, index):
def update(self):
# type: () -> None
table = self.table()
capacity = table.GetChildMemberWithName("bucket_mask").GetValueAsUnsigned() + 1
ctrl = table.GetChildMemberWithName("ctrl").GetChildAtIndex(0)
inner_table = table.GetChildMemberWithName("table")

self.size = table.GetChildMemberWithName("items").GetValueAsUnsigned()
capacity = inner_table.GetChildMemberWithName("bucket_mask").GetValueAsUnsigned() + 1
ctrl = inner_table.GetChildMemberWithName("ctrl").GetChildAtIndex(0)

self.size = inner_table.GetChildMemberWithName("items").GetValueAsUnsigned()
self.pair_type = table.type.template_args[0]
if self.pair_type.IsTypedefType():
self.pair_type = self.pair_type.GetTypedefedType()
self.pair_type_size = self.pair_type.GetByteSize()

self.new_layout = not table.GetChildMemberWithName("data").IsValid()
self.new_layout = not inner_table.GetChildMemberWithName("data").IsValid()
if self.new_layout:
self.data_ptr = ctrl.Cast(self.pair_type.GetPointerType())
else:
self.data_ptr = table.GetChildMemberWithName("data").GetChildAtIndex(0)
self.data_ptr = inner_table.GetChildMemberWithName("data").GetChildAtIndex(0)

u8_type = self.valobj.GetTarget().GetBasicType(eBasicTypeUnsignedChar)
u8_type_size = self.valobj.GetTarget().GetBasicType(eBasicTypeUnsignedChar).GetByteSize()
Expand All @@ -563,7 +565,7 @@ def table(self):
# HashSet wraps either std HashMap or hashbrown::HashSet, which both
# wrap hashbrown::HashMap, so either way we "unwrap" twice.
hashbrown_hashmap = self.valobj.GetChildAtIndex(0).GetChildAtIndex(0)
return hashbrown_hashmap.GetChildMemberWithName("table").GetChildMemberWithName("table")
return hashbrown_hashmap.GetChildMemberWithName("table")

def has_children(self):
# type: () -> bool
Expand Down
3 changes: 1 addition & 2 deletions src/librustdoc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ crate struct Options {
crate maybe_sysroot: Option<PathBuf>,
/// Lint information passed over the command-line.
crate lint_opts: Vec<(String, Level)>,
/// Whether to ask rustc to describe the lints it knows. Practically speaking, this will not be
/// used, since we abort if we have no input file, but it's included for completeness.
/// Whether to ask rustc to describe the lints it knows.
crate describe_lints: bool,
/// What level to cap lints at.
crate lint_cap: Option<Level>,
Expand Down
Loading