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 9 pull requests #122067

Closed
wants to merge 35 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d013b5a
Stabilize the `#[diagnostic]` namespace and `#[diagnostic::on_unimple…
weiznich Jan 12, 2024
a9a9798
Removing absolute path in proc-macro
sundeep-kokkonda Mar 4, 2024
cace4b0
doc: Add better explanation
Mar 4, 2024
678e217
bootstrap: print test name on failure even with `verbose-tests=false`
jyn514 Jul 10, 2023
8bfe9db
libtest: Print the names of failed tests eagerly
jyn514 Nov 5, 2023
38a0227
Add compiler support for parsing `f16` and `f128`
tgross35 Mar 3, 2024
6422be2
Enable `f16` and `f128` in HIR
tgross35 Mar 3, 2024
ad307fc
Add feature gates for `f16` and `f128`
tgross35 Mar 3, 2024
1145ba0
Remove unneeded `f16` and `f128` parser tests
tgross35 Mar 3, 2024
b8f45a3
Add UI tests related to feature-gated primitives
tgross35 Mar 4, 2024
2149c45
Bubble up the TyCtxtFeed
oli-obk Feb 14, 2024
31d0a64
Keep `TyCtxtFeed` around longer in the resolver
oli-obk Feb 14, 2024
3b9dfd3
Preserve the `Feed` in local tables
oli-obk Feb 14, 2024
30f2ec2
Eliminate all non-CRATE_DEF_ID uses of `feed_def_id`
oli-obk Feb 14, 2024
5a0c46a
Get rid of `feed_local_def_id`
oli-obk Feb 14, 2024
890dd58
Prevent leaking `Feed`s into query results
oli-obk Feb 19, 2024
3845be6
Prevent feeding `CRATE_DEF_ID` queries outside the resolver
oli-obk Feb 19, 2024
c696d4c
Remove a use of feed_local_crate and make it fail if used within queries
oli-obk Feb 19, 2024
ef00fae
Avoid using feed_unit_query from within queries
oli-obk Feb 19, 2024
beb45df
Apply suggestions
Mar 5, 2024
ebc45c8
Uplift some feeding out of associated_type_for_impl_trait_in_impl and…
compiler-errors Mar 5, 2024
6120de9
Fix linting paths with qself in `unused_qualifications`
Alexendoo Mar 5, 2024
b948f8d
Rollup merge of #113518 - jyn514:streaming-failures, r=cuviper
matthiaskrgr Mar 6, 2024
597c018
Rollup merge of #119888 - weiznich:stablize_diagnostic_namespace, r=c…
matthiaskrgr Mar 6, 2024
ce7a19d
Rollup merge of #121089 - oli-obk:create_def_feed, r=petrochenkov
matthiaskrgr Mar 6, 2024
a128563
Rollup merge of #121926 - tgross35:f16-f128-step3-feature-gate, r=com…
matthiaskrgr Mar 6, 2024
85adf44
Rollup merge of #121959 - sundeep-kokkonda:patch-2, r=davidtwco
matthiaskrgr Mar 6, 2024
ebd3a4f
Rollup merge of #122015 - dev-ardi:master, r=nnethercote
matthiaskrgr Mar 6, 2024
45ffba6
Rollup merge of #122027 - compiler-errors:rpitit-cycle, r=spastorino
matthiaskrgr Mar 6, 2024
42f9c61
Rollup merge of #122038 - Alexendoo:unused-qualifications, r=petroche…
matthiaskrgr Mar 6, 2024
276f399
Move generic `NonZero` `rustc_layout_scalar_valid_range_start` attrib…
reitermarkus Mar 2, 2024
59794f7
Fix lint.
reitermarkus Mar 2, 2024
42309b4
Fix `miri` tests.
reitermarkus Mar 2, 2024
a58eb80
Hide implementation details for `NonZero` auto traits.
reitermarkus Mar 2, 2024
5cef608
Rollup merge of #121885 - reitermarkus:generic-nonzero-inner, r=oli-obk
matthiaskrgr Mar 6, 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
Prev Previous commit
Next Next commit
Apply suggestions
  • Loading branch information
orion GONZALEZ (contractor) committed Mar 5, 2024
commit beb45df84fd287eb5e83fae100aba82fea0cc639
15 changes: 10 additions & 5 deletions compiler/rustc_index/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,26 @@ use crate::{Idx, IndexSlice};

/// An owned contiguous collection of `T`s, indexed by `I` rather than by `usize`.
///
/// Why use this instead of a `Vec`?
/// This enforces the user to index a given IndexVec only with the associated index thus making it
/// impossible to use the wrong index for a given `IndexVec`.
/// ## Why use this instead of a `Vec`?
///
/// An `IndexVec` allows element access only via a specific associated index type, meaning that
/// trying to use the wrong index type (possibly accessing an invalid element) will fail at
/// compile time.
///
/// It also documents what the index is indexing: in a `HashMap<usize, Something>` it's not
/// immediately clear what the `usize` means, while a `HashMap<FieldIdx, Something>` makes it obvious.
///
/// ```compile_fail
/// use rustc_index::{Idx, IndexVec};
///
/// fn f<I1: Idx, I2: Idx>(vec1: IndexVec<I1, u8>, idx1: I1, idx2: I2) {
/// &vec1[idx1]; // Ok
/// &vec1[idx2]; // Error!
/// &vec1[idx2]; // Compile error!
/// }
/// ```
///
/// While it's possible to use `u32` or `usize` directly for `I`,
/// you almost certainly want to use a [`newtype_index!`]-generated type instead.
/// you almost certainly want to use a [`newtype_index!`] generated type instead.
///
/// This allows to index the IndexVec with the new index type.
///
Expand Down
Loading