Commit Graph

262046 Commits

Author SHA1 Message Date
carbotaniuman
49db8a5a99 Add toggle for parse_meta_item unsafe parsing
This makes it possible for the `unsafe(...)` syntax to only be
valid at the top level, and the `NestedMetaItem`s will automatically
reject `unsafe(...)`.
2024-07-30 18:28:43 -05:00
carbotaniuman
d8bc8761a5 Deny unsafe on more builtin attributes 2024-07-29 21:00:09 -05:00
bors
368e2fd458 Auto merge of #128360 - matthiaskrgr:rollup-wwy5mkj, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #126247 (rustdoc: word wrap CamelCase in the item list table and sidebar)
 - #128104 (Not lint pub structs without pub constructors intentionally)
 - #128153 (Stop using `MoveDataParamEnv` for places that don't need a param-env)
 - #128284 (Stabilize offset_of_nested)
 - #128342 (simplify the use of `CiEnv`)
 - #128355 (triagebot: make sure Nora is called Nora)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-29 21:46:59 +00:00
Matthias Krüger
c2616203bc
Rollup merge of #128355 - jieyouxu:rename-nora, r=aDotInTheVoid
triagebot: make sure Nora is called Nora

r? `@Noratrieb`
2024-07-29 21:26:14 +02:00
Matthias Krüger
4d78d11bf9
Rollup merge of #128342 - onur-ozkan:ci-env-usage, r=Kobzol
simplify the use of `CiEnv`

self-explanatory
2024-07-29 21:26:14 +02:00
Matthias Krüger
a73a025190
Rollup merge of #128284 - GKFX:stabilize-offset-of-nested, r=dtolnay,jieyouxu
Stabilize offset_of_nested

Tracking issue #120140. Closes #120140.

As the FCP is now nearing its end I have opened a stabilization PR. I have done this separately to the offset_of_enum feature, since that FCP has not started.

`@rustbot` label  F-offset_of_nested T-lang T-libs-api
2024-07-29 21:26:13 +02:00
Matthias Krüger
b02cf4c274
Rollup merge of #128153 - compiler-errors:mdpe, r=cjgillot
Stop using `MoveDataParamEnv` for places that don't need a param-env

I think not threading through a `ParamEnv` makes it clearer that these functions don't do anything particularly "type systems"-y.

r? cjgillot
2024-07-29 21:26:12 +02:00
Matthias Krüger
91b18a058c
Rollup merge of #128104 - mu001999-contrib:fix/128053, r=petrochenkov
Not lint pub structs without pub constructors intentionally

Fixes #128053
2024-07-29 21:26:12 +02:00
Matthias Krüger
9aedec9313
Rollup merge of #126247 - notriddle:notriddle/word-wrap-item-table, r=GuillaumeGomez
rustdoc: word wrap CamelCase in the item list table and sidebar

This is an alternative to https://github.com/rust-lang/rust/pull/126209. That is, it fixes the issue that affects the very long type names in https://docs.rs/async-stripe/0.31.0/stripe/index.html#structs.

This is, necessarily, a pile of nasty heuristics. We need to balance a few issues:

- Sometimes, there's no real word break. For example, `BTreeMap` should be `BTree<wbr>Map`, not `B<wbr>Tree<wbr>Map`.

- Sometimes, there's a legit word break, but the name is tiny and the HTML overhead isn't worth it. For example, if we're typesetting `TyCtx`, writing `Ty<wbr>Ctx` would have an HTML overhead of 50%. Line breaking inside it makes no sense.

# Screenshots

| Before | After |
| ------ | ----- |
| ![image](https://github.com/rust-lang/rust/assets/1593513/d51201fd-46c0-4f48-aee6-a477eadba288) | ![image](https://github.com/rust-lang/rust/assets/1593513/d8e77582-adcf-4966-bbfd-19dfdad7336a)
2024-07-29 21:26:11 +02:00
bors
612a33f20b Auto merge of #128350 - matthiaskrgr:rollup-bcuhts8, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #127882 (Don't elaborate associated types with Sized bounds in `trait_object_ty` in cfi)
 - #128174 (Don't record trait aliases as marker traits)
 - #128202 (Tell users not to file a bug when using internal library features)
 - #128239 (Don't ICE when encountering error regions when confirming object method candidate)
 - #128337 (skip assoc type during infer source visitor)
 - #128341 (Make `rustc_attr::parse_version` pub)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-29 19:25:46 +00:00
Michael Howell
ac303df4e2 rustdoc: move the wbr after the underscore, instead of before 2024-07-29 10:31:02 -07:00
Michael Howell
3bf8bcfbe0 rustdoc: properly handle path wrapping 2024-07-29 10:31:02 -07:00
Michael Howell
1d339b07ca rustdoc: use <wbr> in sidebar headers
This also improves sidebar layout, so instead of

    BTreeM
    ap

you get this

    BTree
    Map
2024-07-29 10:30:56 -07:00
许杰友 Jieyou Xu (Joe)
f4fa80ff5a triagebot: make sure Nora is called Nora 2024-07-29 17:01:39 +00:00
bors
66e5852c3b Auto merge of #128112 - Oneirical:testidigitation-cantrip, r=jieyouxu
Migrate `share-generics-dylib`, `raw-dylib-import-name-type`, `raw-dylib-link-ordinal` and `raw-dylib-stdcall-ordinal` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Please try:

// try-job: i686-msvc // already successful
try-job: aarch64-apple
try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc
try-job: x86_64-gnu-llvm-18
2024-07-29 16:59:43 +00:00
George Bateman
23f46e5b99
Stabilize offset_of_nested 2024-07-29 17:50:12 +01:00
Michael Goulet
f990239b34 Stop using MoveDataParamEnv for places that don't need a param-env 2024-07-29 11:59:47 -04:00
Matthias Krüger
83734f2802
Rollup merge of #128341 - Alexendoo:parse-version-pub, r=compiler-errors
Make `rustc_attr::parse_version` pub

I'd like to use it in Clippy but I'll make those changes in the Clippy repo after the sync so it doesn't cause a conflict with https://github.com/rust-lang/rust-clippy/pull/13168
2024-07-29 17:46:44 +02:00
Matthias Krüger
5de94b67d4
Rollup merge of #128337 - bvanjoi:issue-121613, r=compiler-errors
skip assoc type during infer source visitor

Fixes #121613

Due to the generic arguments being lost during normalization, the associated type cannot retrieve the correct generics information, so this PR follows this [comment](https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs#L937-L942) and skips `DefKind::AssocTy`

r? `@lcnr`
2024-07-29 17:46:44 +02:00
Matthias Krüger
28c174321a
Rollup merge of #128239 - compiler-errors:error-on-object-cand-confirm, r=oli-obk
Don't ICE when encountering error regions when confirming object method candidate

See the inline comment for an explanation.

Fixes #122914
2024-07-29 17:46:43 +02:00
Matthias Krüger
162db341ee
Rollup merge of #128202 - compiler-errors:internal-lib-features, r=oli-obk
Tell users not to file a bug when using internal library features

Actually fixes #97501. I don't think we should suppress the suggestion to add `#![feature(..)]`, though I guess I could be convinced otherwise.

r? `@Nilstrieb` cc `@RalfJung`

Didn't add a test b/c I don't think we test this for lang features either, but I can confirm it does work.

```
warning: the feature `core_intrinsics` is internal to the compiler or standard library
 --> /home/michael/test.rs:1:12
  |
1 | #![feature(core_intrinsics)]
  |            ^^^^^^^^^^^^^^^
  |
  = note: using it is strongly discouraged
  = note: `#[warn(internal_features)]` on by default

thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:94:25:
broken MIR in Item(DefId(0:6 ~ test[42db]::{impl#0}::add)) (after phase change to runtime-optimized) at bb0[0]:
Cannot perform arithmetic Add on type WrapInt8
stack backtrace:
   0: begin_panic_handler
             at ./library/std/src/panicking.rs:665:5
   1: panic_fmt
             at ./library/core/src/panicking.rs:74:14
   2: fail<alloc::string::String>
             at ./compiler/rustc_mir_transform/src/validate.rs:146:9
   3: run_pass
             at ./compiler/rustc_mir_transform/src/validate.rs:94:13
   4: validate_body
             at ./compiler/rustc_mir_transform/src/pass_manager.rs:193:5
   5: run_passes_inner
             at ./compiler/rustc_mir_transform/src/pass_manager.rs:176:13
   6: rustc_mir_transform::pass_manager::run_passes
             at ./compiler/rustc_mir_transform/src/pass_manager.rs:87:5
   7: run_optimization_passes
             at ./compiler/rustc_mir_transform/src/lib.rs:561:5
   8: inner_optimized_mir
             at ./compiler/rustc_mir_transform/src/lib.rs:667:5
   9: optimized_mir
             at ./compiler/rustc_mir_transform/src/lib.rs:630:21
  10: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:285:13
      [... omitted 22 frames ...]
  11: query_get_at<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>>
             at ./compiler/rustc_middle/src/query/plumbing.rs:145:17
  12: instance_mir
  13: collect_items_of_instance
             at ./compiler/rustc_monomorphize/src/collector.rs:1203:16
  14: {closure#0}
             at ./compiler/rustc_monomorphize/src/collector.rs:447:17
  15: maybe_grow<(), rustc_monomorphize::collector::collect_items_rec::{closure_env#0}>
             at /home/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rs:55:9
  16: ensure_sufficient_stack<(), rustc_monomorphize::collector::collect_items_rec::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/stack.rs:17:5
  17: collect_items_rec
             at ./compiler/rustc_monomorphize/src/collector.rs:446:13
  18: collect_items_rec
             at ./compiler/rustc_monomorphize/src/collector.rs:526:13
  19: {closure#0}
             at ./compiler/rustc_monomorphize/src/collector.rs:1597:17
  20: {closure#0}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:182:34
  21: call_once<(), rustc_data_structures::sync::parallel::enabled::par_for_each_in::{closure#0}::{closure#0}::{closure_env#0}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>>
             at ./library/core/src/panic/unwind_safe.rs:272:9
  22: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::enabled::par_for_each_in::{closure#0}::{closure#0}::{closure_env#0}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>>, ()>
             at ./library/std/src/panicking.rs:557:40
  23: try<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::enabled::par_for_each_in::{closure#0}::{closure#0}::{closure_env#0}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>>>
             at ./library/std/src/panicking.rs:521:19
  24: run<(), rustc_data_structures::sync::parallel::enabled::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:28:9
  25: {closure#1}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:186:21
  26: {closure#0}<rustc_middle::mir::mono::MonoItem, rustc_data_structures::sync::parallel::enabled::par_for_each_in::{closure#0}::{closure_env#1}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>>
             at ./library/core/src/iter/traits/iterator.rs:815:29
  27: fold<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global, (), core::iter::traits::iterator::Iterator::for_each::call::{closure_env#0}<rustc_middle::mir::mono::MonoItem, rustc_data_structures::sync::parallel::enabled::par_for_each_in::{closure#0}::{closure_env#1}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>>>
             at ./library/alloc/src/vec/into_iter.rs:317:25
  28: for_each<alloc::vec::into_iter::IntoIter<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_data_structures::sync::parallel::enabled::par_for_each_in::{closure#0}::{closure_env#1}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>>
             at ./library/core/src/iter/traits/iterator.rs:818:9
  29: {closure#0}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:185:17
  30: parallel_guard<(), rustc_data_structures::sync::parallel::enabled::par_for_each_in::{closure_env#0}<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:44:15
  31: par_for_each_in<rustc_middle::mir::mono::MonoItem, alloc::vec::Vec<rustc_middle::mir::mono::MonoItem, alloc::alloc::Global>, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:178:9
  32: {closure#1}
             at ./compiler/rustc_monomorphize/src/collector.rs:1595:13
  33: run<(), rustc_monomorphize::collector::collect_crate_mono_items::{closure_env#1}>
             at ./compiler/rustc_data_structures/src/profiling.rs:754:9
  34: time<(), rustc_monomorphize::collector::collect_crate_mono_items::{closure_env#1}>
             at ./compiler/rustc_session/src/utils.rs:16:9
  35: collect_crate_mono_items
             at ./compiler/rustc_monomorphize/src/collector.rs:1594:9
  36: collect_and_partition_mono_items
             at ./compiler/rustc_monomorphize/src/partitioning.rs:1124:30
  37: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:281:9
      [... omitted 22 frames ...]
  38: query_get_at<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 24]>>>
             at ./compiler/rustc_middle/src/query/plumbing.rs:145:17
  39: collect_and_partition_mono_items
             at ./compiler/rustc_middle/src/query/plumbing.rs:423:31
  40: collect_and_partition_mono_items
             at ./compiler/rustc_middle/src/query/plumbing.rs:414:17
  41: codegen_crate<rustc_codegen_llvm::LlvmCodegenBackend>
             at ./compiler/rustc_codegen_ssa/src/base.rs:596:25
  42: codegen_crate
             at ./compiler/rustc_codegen_llvm/src/lib.rs:361:18
  43: {closure#0}
             at ./compiler/rustc_interface/src/passes.rs:1027:9
  44: run<alloc::boxed::Box<dyn core::any::Any, alloc::alloc::Global>, rustc_interface::passes::start_codegen::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/profiling.rs:754:9
  45: time<alloc::boxed::Box<dyn core::any::Any, alloc::alloc::Global>, rustc_interface::passes::start_codegen::{closure_env#0}>
             at ./compiler/rustc_session/src/utils.rs:16:9
  46: start_codegen
             at ./compiler/rustc_interface/src/passes.rs:1026:19
  47: codegen_and_build_linker
             at ./compiler/rustc_interface/src/queries.rs:128:31
  48: {closure#6}
             at ./compiler/rustc_driver_impl/src/lib.rs:451:25
  49: {closure#1}<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure_env#6}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             at ./compiler/rustc_middle/src/ty/context.rs:1336:37
  50: {closure#0}<rustc_middle::ty::context::{impl#19}::enter::{closure_env#1}<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure_env#6}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             at ./compiler/rustc_middle/src/ty/context/tls.rs:82:9
  51: try_with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#19}::enter::{closure_env#1}<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure_env#6}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             at ./library/std/src/thread/local.rs:283:12
  52: with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#19}::enter::{closure_env#1}<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure_env#6}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             at ./library/std/src/thread/local.rs:260:9
  53: enter_context<rustc_middle::ty::context::{impl#19}::enter::{closure_env#1}<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure_env#6}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             at ./compiler/rustc_middle/src/ty/context/tls.rs:79:5
  54: enter<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure_env#6}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             at ./compiler/rustc_middle/src/ty/context.rs:1336:9
  55: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#6}>
             at ./compiler/rustc_interface/src/queries.rs:64:9
  56: {closure#1}
             at ./compiler/rustc_driver_impl/src/lib.rs:450:13
  57: enter<rustc_driver_impl::run_compiler::{closure#0}::{closure_env#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             at ./compiler/rustc_interface/src/queries.rs:209:19
  58: {closure#0}
             at ./compiler/rustc_driver_impl/src/lib.rs:388:22
  59: {closure#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure_env#0}>
             at ./compiler/rustc_interface/src/interface.rs:502:27
  60: {closure#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at ./compiler/rustc_interface/src/util.rs:154:13
  61: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at ./compiler/rustc_interface/src/util.rs:106:21
  62: set<rustc_span::SessionGlobals, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at /home/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/scoped-tls-1.0.1/src/lib.rs:137:9
  63: create_session_globals_then<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>>
             at ./compiler/rustc_span/src/lib.rs:134:5
  64: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at ./compiler/rustc_interface/src/util.rs:105:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: rustc 1.82.0-dev running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [optimized_mir] optimizing MIR for `<impl at /home/michael/test.rs:9:1: 9:32>::add`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
```
2024-07-29 17:46:43 +02:00
Matthias Krüger
5551f54aa1
Rollup merge of #128174 - compiler-errors:trait-alias-marker, r=oli-obk
Don't record trait aliases as marker traits

Don't record `#[marker]` on trait aliases, since we use that to check for the (non-presence of) associated types and other things which don't make sense of trait aliases. We already enforce this attr is only applied to a trait.

Also do the same for `#[const_trait]`, which we also enforce is only applied to a trait. This is a drive-by change, but also worthwhile just in case.

Fixes #127222
2024-07-29 17:46:42 +02:00
Matthias Krüger
2e9d962a8b
Rollup merge of #127882 - compiler-errors:cfi-sized-self-gat, r=oli-obk
Don't elaborate associated types with Sized bounds in `trait_object_ty` in cfi

The elaboration mechanism introduced in #123005 didn't filter for associated types with `Self: Sized` bounds, which since #112319 has excluded them from the object type.

Fixes #127881
cc `@maurer` `@rcvalle`
2024-07-29 17:46:42 +02:00
Michael Howell
9186001f34 rustdoc: avoid redundant HTML when there's already line breaks 2024-07-29 08:46:25 -07:00
Michael Howell
0d0e18e7f6 rustdoc: use <wbr>-tolerant function to check text contents 2024-07-29 08:46:11 -07:00
Michael Howell
583bf1e5bf Fix tidy call in runtest with custom HTML element 2024-07-29 08:46:01 -07:00
Michael Howell
f3661dce09 rustdoc: word wrap CamelCase in the item list table
This is an alternative to ee6459d652.
That is, it fixes the issue that affects the very long type names
in https://docs.rs/async-stripe/0.31.0/stripe/index.html#structs.

This is, necessarily, a pile of nasty heuristics.
We need to balance a few issues:

- Sometimes, there's no real word break.
  For example, `BTreeMap` should be `BTree<wbr>Map`,
  not `B<wbr>Tree<wbr>Map`.

- Sometimes, there's a legit word break,
  but the name is tiny and the HTML overhead isn't worth it.
  For example, if we're typesetting `TyCtx`,
  writing `Ty<wbr>Ctx` would have an HTML overhead of 50%.
  Line breaking inside it makes no sense.
2024-07-29 08:45:50 -07:00
Oneirical
23cccb3fc6 rewrite raw-dylib-stdcall-ordinal to rmake 2024-07-29 10:58:28 -04:00
Oneirical
9ffe161ce8 rewrite raw-dylib-link-ordinal to rmake 2024-07-29 10:58:28 -04:00
Oneirical
8c09a7f11e rewrite raw-dylib-import-name-type to rmake 2024-07-29 10:58:28 -04:00
Oneirical
0c8f194737 rewrite share-generics-dylib to rmake 2024-07-29 10:58:27 -04:00
bohan
97469cc4bf only accept adt type during infer source visitor 2024-07-29 22:29:34 +08:00
onur-ozkan
06d64ea4c4 simplify the use of CiEnv
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29 16:33:44 +03:00
Alex Macleod
eb0e71620d Make rustc_attr::parse_version pub 2024-07-29 13:11:29 +00:00
bors
4db3d12e6f Auto merge of #128265 - DianQK:instsimplify-before-inline, r=saethlin
Perform instsimplify before inline to eliminate some trivial calls

I am currently working on #128081. In the current pipeline, we can get the following clone statements ([godbolt](https://rust.godbolt.org/z/931316fhP)):

```
    bb0: {
        StorageLive(_2);
        _2 = ((*_1).0: i32);
        StorageLive(_3);
        _3 = ((*_1).1: u64);
        _0 = Foo { a: move _2, b: move _3 };
        StorageDead(_3);
        StorageDead(_2);
        return;
    }
```

Analyzing such statements will be simple and fast. We don't need to consider branches or some interfering statements. However, this requires us to run `InstSimplify`, `ReferencePropagation`, and `SimplifyCFG` at least once. I can introduce a new pass, but I think the best place for it would be within `InstSimplify`.

I put `InstSimplify` before `Inline`, which takes some of the burden away from `Inline`.

r? `@saethlin`
2024-07-29 12:36:57 +00:00
DianQK
ae681c940d
Perform instsimplify before inline to eliminate some trivial calls 2024-07-29 18:14:35 +08:00
bors
56c698c711 Auto merge of #128334 - matthiaskrgr:rollup-nhxdt0c, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #128182 (handle no_std targets on std builds)
 - #128277 (miri: fix offset_from behavior on wildcard pointers)
 - #128304 (Isolate the diagnostic code that expects `thir::Pat` to be printable)
 - #128307 (Clean and enable `rustdoc::unescaped_backticks` for `core/alloc/std/test/proc_macro`)
 - #128322 (CI: move RFL job forward to v6.11-rc1)
 - #128333 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-29 10:05:42 +00:00
Matthias Krüger
624f9bdec9
Rollup merge of #128333 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-07-29 11:42:36 +02:00
Matthias Krüger
43c50bc096
Rollup merge of #128322 - ojeda:rfl-ci-update, r=Kobzol
CI: move RFL job forward to v6.11-rc1

The tag has been released today, and since the original hash we had in the Rust CI (which was ~v6.10-rc1), we have accumulated a fair amount of changes and new code.

In particular, v6.11-rc1 is the first Linux tag where the kernel is supporting an actual minimum Rust version (1.78.0), rather than a single version.

---
Let's try to do the move independently first.
r? ``@Kobzol``

try-job: x86_64-rust-for-linux
2024-07-29 11:42:35 +02:00
Matthias Krüger
8f7af88b33
Rollup merge of #128307 - ojeda:unescaped_backticks, r=GuillaumeGomez
Clean and enable `rustdoc::unescaped_backticks` for `core/alloc/std/test/proc_macro`

I am not sure if the lint is supposed to be "ready enough" (since it is `allow` by default), but it does catch a couple issues in `core` (`alloc`, `std`, `test` and `proc_macro` are already clean), so I propose making it `warn` in all the crates rendered in the website.

Cc: `@GuillaumeGomez`
2024-07-29 11:42:35 +02:00
Matthias Krüger
d73decdaad
Rollup merge of #128304 - Zalathar:thir-pat-display, r=Nadrieril
Isolate the diagnostic code that expects `thir::Pat` to be printable

Currently, `thir::Pat` implements `fmt::Display` (and `IntoDiagArg`) directly, for use by a few diagnostics.

That makes it tricky to experiment with alternate representations for THIR patterns, because the patterns currently need to be printable on their own. That immediately rules out possibilities like storing subpatterns as a `PatId` index into a central list (instead of the current directly-owned `Box<Pat>`).

This PR therefore takes an incremental step away from that obstacle, by removing `thir::Pat` from diagnostic structs in `rustc_pattern_analysis`, and hiding the pattern-printing process behind a single public `Pat::to_string` method. Doing so makes it easier to identify and update the code that wants to print patterns, and gives a place to pass in additional context in the future if necessary.

---

I'm currently not sure whether switching over to `PatId` is actually desirable or not, but I think this change makes sense on its own merits, by reducing the coupling between `thir::Pat` and the pattern-analysis error types.
2024-07-29 11:42:34 +02:00
Matthias Krüger
eb8114bad7
Rollup merge of #128277 - RalfJung:offset_from_wildcard, r=oli-obk
miri: fix offset_from behavior on wildcard pointers

offset_from wouldn't behave correctly when the "end" pointer was a wildcard pointer (result of an int2ptr cast) just at the end of the allocation. Fix that by expressing the "same allocation" check in terms of two `check_ptr_access_signed` instead of something specific to offset_from, which is both more canonical and works better with wildcard pointers.

The second commit just improves diagnostics: I wanted the "pointer is dangling (has no provenance)" message to say how many bytes of memory it expected to see (since if it were 0 bytes, this would actually be legal, so it's good to tell the user that it's not 0 bytes). And then I was annoying that the error looks so different for when you deref a dangling pointer vs an out-of-bounds pointer so I made them more similar.

Fixes https://github.com/rust-lang/miri/issues/3767
2024-07-29 11:42:34 +02:00
Matthias Krüger
7e6943d67f
Rollup merge of #128182 - onur-ozkan:fix-no-std-crates, r=Mark-Simulacrum
handle no_std targets on std builds

This PR unifies the `Step::run_make` logic and improves it by skipping std specific crates for no_std targets. In addition, since we now handle library crates properly, bootstrap is capable of running `x doc library` even for no_std targets as it is able to generate documentation for `alloc` crate from the standard library.

Resolves #128027

cc ``@ChrisDenton``
2024-07-29 11:42:33 +02:00
onur-ozkan
f56d58e4a7 ignore crates if running unit tests
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29 10:43:37 +03:00
onur-ozkan
d3aed2cdb4 remove the requirement of Builder arg in doc::Std::new function
`crates` field is handled in the `Step::make_run` just like in any other
`Std` implementation, so we don't need to resolve them in `Std::new`.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29 10:43:35 +03:00
onur-ozkan
4c87e84f99 allow running x doc on std for no_std targets
Since we now handle library crates properly, there's no need to panic for `no_std`
targets anymore.

`x doc library` now generates documentation for the `alloc` crate from standard library.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29 10:43:31 +03:00
onur-ozkan
6e247195c6 handle no_std targets on std builds
This change unifies the `Step::run_make` logic and improves it by skipping
std specific crates for no_std targets.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29 10:43:24 +03:00
bors
80d8270d84 Auto merge of #125016 - nicholasbishop:bishop-cb-112, r=tgross35
Update compiler_builtins to 0.1.114

The `weak-intrinsics` feature was removed from compiler_builtins in https://github.com/rust-lang/compiler-builtins/pull/598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot.

In https://github.com/rust-lang/compiler-builtins/pull/593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
2024-07-29 07:41:33 +00:00
bors
a5ee5cbad1 Auto merge of #128330 - matthiaskrgr:rollup-auairjd, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #109174 (Replace `io::Cursor::{remaining_slice, is_empty}`)
 - #127290 (Fully document `rustdoc-json-types`)
 - #128055 (std: unsafe-wrap personality::dwarf::eh)
 - #128269 (improve cargo invocations on bootstrap)
 - #128310 (Add missing periods on `BTreeMap` cursor `peek_next` docs)

Failed merges:

 - #127543 (More unsafe attr verification)
 - #128182 (handle no_std targets on std builds)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-29 05:19:10 +00:00
Matthias Krüger
0c6d2fb3dc
Rollup merge of #128310 - kmicklas:btree-map-peek-next-docs, r=tgross35
Add missing periods on `BTreeMap` cursor `peek_next` docs

Tracking issue: https://github.com/rust-lang/rust/issues/107540
2024-07-29 07:11:16 +02:00