rust/compiler/rustc_codegen_llvm/src
Jonas Schievink 8825942e86
Rollup merge of #77802 - jyn514:bootstrap-specific, r=nikomatsakis
Allow making `RUSTC_BOOTSTRAP` conditional on the crate name

Motivation: This came up in the [Zulip stream](https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Require.20users.20to.20confirm.20they.20know.20RUSTC_.E2.80.A6.20compiler-team.23350/near/208403962) for https://github.com/rust-lang/compiler-team/issues/350.
See also https://github.com/rust-lang/cargo/pull/6608#issuecomment-458546258; this implements https://github.com/rust-lang/cargo/issues/6627.
The goal is for this to eventually allow prohibiting setting `RUSTC_BOOTSTRAP` in build.rs (https://github.com/rust-lang/cargo/issues/7088).

## User-facing changes

- `RUSTC_BOOTSTRAP=1` still works; there is no current plan to remove this.
- Things like `RUSTC_BOOTSTRAP=0` no longer activate nightly features. In practice this shouldn't be a big deal, since `RUSTC_BOOTSTRAP` is the opposite of stable and everyone uses `RUSTC_BOOTSTRAP=1` anyway.
- `RUSTC_BOOTSTRAP=x` will enable nightly features only for crate `x`.
- `RUSTC_BOOTSTRAP=x,y` will enable nightly features only for crates `x` and `y`.

## Implementation changes

The main change is that `UnstableOptions::from_environment` now requires
an (optional) crate name. If the crate name is unknown (`None`), then the new feature is not available and you still have to use `RUSTC_BOOTSTRAP=1`. In practice this means the feature is only available for `--crate-name`, not for `#![crate_name]`; I'm interested in supporting the second but I'm not sure how.

Other major changes:

- Added `Session::is_nightly_build()`, which uses the `crate_name` of
the session
- Added `nightly_options::match_is_nightly_build`, a convenience method
for looking up `--crate-name` from CLI arguments.
`Session::is_nightly_build()`should be preferred where possible, since
it will take into account `#![crate_name]` (I think).
- Added `unstable_features` to `rustdoc::RenderOptions`

I'm not sure whether this counts as T-compiler or T-lang; _technically_ RUSTC_BOOTSTRAP is an implementation detail, but it's been used so much it seems like this counts as a language change too.

r? `@joshtriplett`
cc `@Mark-Simulacrum` `@hsivonen`
2020-11-15 13:39:43 +01:00
..
back Rollup merge of #78848 - DevJPM:ci-llvm-9, r=nikic 2020-11-15 03:02:39 +01:00
coverageinfo Addressed all feedback to date 2020-11-05 18:24:17 -08:00
debuginfo Collapse all uses of target.options.foo into target.foo 2020-11-08 17:29:13 +03:00
llvm Rollup merge of #77950 - arlosi:sha256, r=eddyb 2020-11-03 19:32:26 +01:00
abi.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
allocator.rs Collapse all uses of target.options.foo into target.foo 2020-11-08 17:29:13 +03:00
asm.rs Change capitalization of Spirv to SpirV 2020-11-11 19:18:06 +01:00
attributes.rs fixed a re-format due to removed chain call 2020-11-12 14:40:41 +01:00
base.rs Replace target.target with target and target.ptr_width with target.pointer_width 2020-10-15 12:02:24 +02:00
builder.rs Fix even more clippy warnings 2020-10-30 10:13:39 -04:00
callee.rs rustc_target: Rename some target options to avoid tautology 2020-11-08 17:29:13 +03:00
common.rs s/Scalar::Raw/Scalar::Int 2020-11-04 10:11:31 +00:00
consts.rs Collapse all uses of target.options.foo into target.foo 2020-11-08 17:29:13 +03:00
context.rs Removed an unused function now that LLVM 9 is the minimal supported version 2020-11-12 14:39:47 +01:00
declare.rs Collapse all uses of target.options.foo into target.foo 2020-11-08 17:29:13 +03:00
intrinsic.rs Changed unwrap_or to unwrap_or_else in some places. 2020-11-10 20:07:47 -08:00
lib.rs Rollup merge of #77795 - bjorn3:codegen_backend_interface_refactor, r=oli-obk 2020-10-14 02:30:38 +02:00
llvm_util.rs Rollup merge of #77802 - jyn514:bootstrap-specific, r=nikomatsakis 2020-11-15 13:39:43 +01:00
metadata.rs Collapse all uses of target.options.foo into target.foo 2020-11-08 17:29:13 +03:00
mono_item.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
type_.rs Remove MMX from Rust 2020-09-20 15:13:11 +02:00
type_of.rs Remove MMX from Rust 2020-09-20 15:13:11 +02:00
va_arg.rs rustc_target: Rename some target options to avoid tautology 2020-11-08 17:29:13 +03:00
value.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00