Skip to content
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

Rollup of 10 pull requests #129463

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e65a48e
Document WebAssembly target feature expectations
alexcrichton Aug 1, 2024
dea3846
Review comments
alexcrichton Aug 1, 2024
927633c
Add a note about libraries and `#[target_feature]`
alexcrichton Aug 1, 2024
cfe3ea6
Add new page to SUMMARY.md
alexcrichton Aug 1, 2024
ce7f1b7
Ignore two new doc blocks in testing
alexcrichton Aug 1, 2024
b6f65a4
Document on-by-default features
alexcrichton Aug 1, 2024
a5082ef
Appease tidy
alexcrichton Aug 1, 2024
06197ef
Review comments
alexcrichton Aug 2, 2024
7d2595f
Review comments
alexcrichton Aug 9, 2024
6a8ec81
Add a missing compatibility note in the 1.80.0 release notes
apiraino Aug 19, 2024
cd7cc3f
Update RELEASES.md
apiraino Aug 19, 2024
7613eee
Update RELEASES.md
apiraino Aug 19, 2024
dbad758
Stabilize feature `char_indices_offset`
eduardosm Aug 19, 2024
16fd460
Remove duplicated usage of `-Zunstable-options` in bootstrap
GuillaumeGomez Aug 19, 2024
0a8343c
do not build `cargo-miri` by default on stable channel
onur-ozkan Aug 18, 2024
0ce7705
document `miri` and `cargo-miri` in `build.tools`
onur-ozkan Aug 18, 2024
87e4b67
Update RELEASES.md
apiraino Aug 22, 2024
6a878a9
Fix handling of macro arguments within the `dropping_copy_types lint
Urgau Aug 22, 2024
f1fac42
llvm 20: adapt integer comparison tests
krasimirgg Aug 21, 2024
8151de2
rustdoc-search: use tighter json for names and parents
notriddle Aug 22, 2024
b544603
Fix typo in help diagnostic
gurry Aug 23, 2024
2339560
kobzol vacation
Kobzol Aug 23, 2024
1bf70a3
Rollup merge of #128511 - alexcrichton:doc-wasm-features, r=jieyouxu
GuillaumeGomez Aug 23, 2024
da91e23
Rollup merge of #129243 - onur-ozkan:stuff, r=Kobzol
GuillaumeGomez Aug 23, 2024
f79e5d4
Rollup merge of #129263 - apiraino:add-missing-compat-note, r=cuviper
GuillaumeGomez Aug 23, 2024
8648c3f
Rollup merge of #129276 - eduardosm:stabilize-char_indices_offset, r=…
GuillaumeGomez Aug 23, 2024
c1b0007
Rollup merge of #129278 - GuillaumeGomez:rm-duplicated-usage-of-unsta…
GuillaumeGomez Aug 23, 2024
541ad79
Rollup merge of #129350 - krasimirgg:llvm20, r=nikic
GuillaumeGomez Aug 23, 2024
2d0750f
Rollup merge of #129408 - Urgau:macro-arg-drop_copy, r=compiler-errors
GuillaumeGomez Aug 23, 2024
bfb2c99
Rollup merge of #129426 - notriddle:smaller-index-2024-08-22, r=Guill…
GuillaumeGomez Aug 23, 2024
711cbcc
Rollup merge of #129437 - gurry:fix-diagnostic-typo, r=jieyouxu
GuillaumeGomez Aug 23, 2024
f47a42f
Rollup merge of #129457 - Kobzol:kobzol-vacation, r=Kobzol
GuillaumeGomez Aug 23, 2024
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: 2 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ Compatibility Notes
- [Turn `proc_macro_back_compat` lint into a hard error.](https://github.com/rust-lang/rust/pull/125596/)
- [Detect unused structs even when implementing private traits](https://github.com/rust-lang/rust/pull/122382/)
- [`std::sync::ReentrantLockGuard<T>` is no longer `Sync` if `T: !Sync`](https://github.com/rust-lang/rust/pull/125527) which means [`std::io::StdoutLock` and `std::io::StderrLock` are no longer Sync](https://github.com/rust-lang/rust/issues/127340)
- [Type inference will fail in some cases due to new implementations of `FromIterator for Box<str>`.](https://github.com/rust-lang/rust/pull/99969/)
Notably, this breaks versions of the `time` crate before 0.3.35, due to no longer inferring the implementation for `Box<[_]>`.

<a id="1.80-Internal-Changes"></a>

Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_lint/src/drop_forget_useless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
&& let Node::Stmt(stmt) = node
&& let StmtKind::Semi(e) = stmt.kind
&& e.hir_id == expr.hir_id
&& let Some(arg_span) = arg.span.find_ancestor_inside(expr.span)
{
UseLetUnderscoreIgnoreSuggestion::Suggestion {
start_span: expr.span.shrink_to_lo().until(arg.span),
end_span: arg.span.shrink_to_hi().until(expr.span.shrink_to_hi()),
start_span: expr.span.shrink_to_lo().until(arg_span),
end_span: arg_span.shrink_to_hi().until(expr.span.shrink_to_hi()),
}
} else {
UseLetUnderscoreIgnoreSuggestion::Note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
StringPart::highlighted("multiple different versions".to_string()),
StringPart::normal(" of crate `".to_string()),
StringPart::highlighted(format!("{name}")),
StringPart::normal("` the your dependency graph".to_string()),
StringPart::normal("` in the dependency graph".to_string()),
],
);
let candidates = if impl_candidates.is_empty() {
Expand Down
1 change: 1 addition & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
# "analysis",
# "src",
# "wasm-component-ld",
# "miri", "cargo-miri" # for dev/nightly channels
#]

# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == print environment variables on each rustc invocation
Expand Down
1 change: 0 additions & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
#![cfg_attr(bootstrap, feature(offset_of_nested))]
#![feature(array_ptr_get)]
#![feature(asm_experimental_arch)]
#![feature(char_indices_offset)]
#![feature(const_align_of_val)]
#![feature(const_align_of_val_raw)]
#![feature(const_align_offset)]
Expand Down
15 changes: 13 additions & 2 deletions library/core/src/str/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,24 +241,35 @@ impl<'a> CharIndices<'a> {
/// Returns the byte position of the next character, or the length
/// of the underlying string if there are no more characters.
///
/// This means that, when the iterator has not been fully consumed,
/// the returned value will match the index that will be returned
/// by the next call to [`next()`](Self::next).
///
/// # Examples
///
/// ```
/// #![feature(char_indices_offset)]
/// let mut chars = "a楽".char_indices();
///
/// // `next()` has not been called yet, so `offset()` returns the byte
/// // index of the first character of the string, which is always 0.
/// assert_eq!(chars.offset(), 0);
/// // As expected, the first call to `next()` also returns 0 as index.
/// assert_eq!(chars.next(), Some((0, 'a')));
///
/// // `next()` has been called once, so `offset()` returns the byte index
/// // of the second character ...
/// assert_eq!(chars.offset(), 1);
/// // ... which matches the index returned by the next call to `next()`.
/// assert_eq!(chars.next(), Some((1, '楽')));
///
/// // Once the iterator has been consumed, `offset()` returns the length
/// // in bytes of the string.
/// assert_eq!(chars.offset(), 4);
/// assert_eq!(chars.next(), None);
/// ```
#[inline]
#[must_use]
#[unstable(feature = "char_indices_offset", issue = "83871")]
#[stable(feature = "char_indices_offset", since = "CURRENT_RUSTC_VERSION")]
pub fn offset(&self) -> usize {
self.front_offset
}
Expand Down
2 changes: 0 additions & 2 deletions src/bootstrap/src/bin/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ fn main() {
if stage == "0" {
cmd.arg("--cfg=bootstrap");
}
cmd.arg("-Zunstable-options");
cmd.arg("--check-cfg=cfg(bootstrap)");

maybe_dump(format!("stage{stage}-rustdoc"), &cmd);

Expand Down
19 changes: 7 additions & 12 deletions src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,11 @@ fn invoke_rustdoc(
.arg(&out)
.arg(&path)
.arg("--markdown-css")
.arg("../rust.css");
.arg("../rust.css")
.arg("-Zunstable-options");

if !builder.config.docs_minification {
cmd.arg("-Z").arg("unstable-options").arg("--disable-minification");
cmd.arg("--disable-minification");
}

cmd.run(builder);
Expand Down Expand Up @@ -376,8 +377,6 @@ impl Step for Standalone {
}

let mut cmd = builder.rustdoc_cmd(compiler);
// Needed for --index-page flag
cmd.arg("-Z").arg("unstable-options");

cmd.arg("--html-after-content")
.arg(&footer)
Expand All @@ -386,6 +385,7 @@ impl Step for Standalone {
.arg("--html-in-header")
.arg(&favicon)
.arg("--markdown-no-toc")
.arg("-Zunstable-options")
.arg("--index-page")
.arg(builder.src.join("src/doc/index.md"))
.arg("--markdown-playground-url")
Expand Down Expand Up @@ -478,9 +478,6 @@ impl Step for Releases {
mem::drop(tmpfile);
let mut cmd = builder.rustdoc_cmd(compiler);

// Needed for --index-page flag
cmd.arg("-Z").arg("unstable-options");

cmd.arg("--html-after-content")
.arg(&footer)
.arg("--html-before-content")
Expand All @@ -490,6 +487,7 @@ impl Step for Releases {
.arg("--markdown-no-toc")
.arg("--markdown-css")
.arg("rust.css")
.arg("-Zunstable-options")
.arg("--index-page")
.arg(builder.src.join("src/doc/index.md"))
.arg("--markdown-playground-url")
Expand Down Expand Up @@ -636,6 +634,8 @@ impl Step for Std {
if !builder.config.docs_minification {
extra_args.push("--disable-minification");
}
// For `--index-page` and `--output-format=json`.
extra_args.push("-Zunstable-options");

doc_std(builder, self.format, stage, target, &out, &extra_args, &crates);

Expand Down Expand Up @@ -715,8 +715,6 @@ fn doc_std(
.arg("--target-dir")
.arg(&*target_dir.to_string_lossy())
.arg("-Zskip-rustdoc-fingerprint")
.rustdocflag("-Z")
.rustdocflag("unstable-options")
.rustdocflag("--resource-suffix")
.rustdocflag(&builder.version);
for arg in extra_args {
Expand Down Expand Up @@ -822,15 +820,13 @@ impl Step for Rustc {
// Since we always pass --document-private-items, there's no need to warn about linking to private items.
cargo.rustdocflag("-Arustdoc::private-intra-doc-links");
cargo.rustdocflag("--enable-index-page");
cargo.rustdocflag("-Zunstable-options");
cargo.rustdocflag("-Znormalize-docs");
cargo.rustdocflag("--show-type-layout");
// FIXME: `--generate-link-to-definition` tries to resolve cfged out code
// see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
// cargo.rustdocflag("--generate-link-to-definition");

compile::rustc_cargo(builder, &mut cargo, target, &compiler);
cargo.arg("-Zunstable-options");
cargo.arg("-Zskip-rustdoc-fingerprint");

// Only include compiler crates, no dependencies of those, such as `libc`.
Expand Down Expand Up @@ -986,7 +982,6 @@ macro_rules! tool_doc {
cargo.rustdocflag("-Arustdoc::private-intra-doc-links");
cargo.rustdocflag("--enable-index-page");
cargo.rustdocflag("--show-type-layout");
cargo.rustdocflag("-Zunstable-options");
// FIXME: `--generate-link-to-definition` tries to resolve cfged out code
// see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
// cargo.rustdocflag("--generate-link-to-definition");
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ tool_extended!((self, builder),
CargoClippy, "src/tools/clippy", "cargo-clippy", stable=true;
Clippy, "src/tools/clippy", "clippy-driver", stable=true, add_bins_to_sysroot = ["clippy-driver", "cargo-clippy"];
Miri, "src/tools/miri", "miri", stable=false, add_bins_to_sysroot = ["miri"];
CargoMiri, "src/tools/miri/cargo-miri", "cargo-miri", stable=true, add_bins_to_sysroot = ["cargo-miri"];
CargoMiri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, add_bins_to_sysroot = ["cargo-miri"];
Rls, "src/tools/rls", "rls", stable=true;
Rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, add_bins_to_sysroot = ["rustfmt", "cargo-fmt"];
);
Expand Down
13 changes: 1 addition & 12 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,6 @@ impl<'a> Builder<'a> {
rustflags.arg("-Csymbol-mangling-version=v0");
} else {
rustflags.arg("-Csymbol-mangling-version=legacy");
rustflags.arg("-Zunstable-options");
}

// Enable compile-time checking of `cfg` names, values and Cargo `features`.
Expand Down Expand Up @@ -1860,16 +1859,7 @@ impl<'a> Builder<'a> {
},
);

let split_debuginfo = self.config.split_debuginfo(target);
let split_debuginfo_is_stable = target.contains("linux")
|| target.contains("apple")
|| (target.is_msvc() && split_debuginfo == SplitDebuginfo::Packed)
|| (target.is_windows() && split_debuginfo == SplitDebuginfo::Off);

if !split_debuginfo_is_stable {
rustflags.arg("-Zunstable-options");
}
match split_debuginfo {
match self.config.split_debuginfo(target) {
SplitDebuginfo::Packed => rustflags.arg("-Csplit-debuginfo=packed"),
SplitDebuginfo::Unpacked => rustflags.arg("-Csplit-debuginfo=unpacked"),
SplitDebuginfo::Off => rustflags.arg("-Csplit-debuginfo=off"),
Expand Down Expand Up @@ -2046,7 +2036,6 @@ impl<'a> Builder<'a> {
}

if mode == Mode::Rustc {
rustflags.arg("-Zunstable-options");
rustflags.arg("-Wrustc::internal");
// FIXME(edition_2024): Change this to `-Wrust_2024_idioms` when all
// of the individual lints are satisfied.
Expand Down
1 change: 1 addition & 0 deletions src/doc/rustc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
- [wasm32-wasip1](platform-support/wasm32-wasip1.md)
- [wasm32-wasip1-threads](platform-support/wasm32-wasip1-threads.md)
- [wasm32-wasip2](platform-support/wasm32-wasip2.md)
- [wasm32-unknown-unknown](platform-support/wasm32-unknown-unknown.md)
- [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md)
- [\*-win7-windows-msvc](platform-support/win7-windows-msvc.md)
- [x86_64-fortanix-unknown-sgx](platform-support/x86_64-fortanix-unknown-sgx.md)
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ target | std | notes
[`thumbv8m.main-none-eabi`](platform-support/thumbv8m.main-none-eabi.md) | * | Bare Armv8-M Mainline
[`thumbv8m.main-none-eabihf`](platform-support/thumbv8m.main-none-eabi.md) | * | Bare Armv8-M Mainline, hardfloat
`wasm32-unknown-emscripten` | ✓ | WebAssembly via Emscripten
`wasm32-unknown-unknown` | ✓ | WebAssembly
[`wasm32-unknown-unknown`](platform-support/wasm32-unknown-unknown.md) | ✓ | WebAssembly
`wasm32-wasi` | ✓ | WebAssembly with WASI (undergoing a [rename to `wasm32-wasip1`][wasi-rename])
[`wasm32-wasip1`](platform-support/wasm32-wasip1.md) | ✓ | WebAssembly with WASI
[`wasm32-wasip1-threads`](platform-support/wasm32-wasip1-threads.md) | ✓ | WebAssembly with WASI Preview 1 and threads
Expand Down
Loading
Loading