Skip to content

Implement libstd. #17

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

Closed
wants to merge 83 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
65e131e
Prepare 1.50 beta
Mark-Simulacrum Dec 29, 2020
d17ca57
Update fulldeps test
Mark-Simulacrum Oct 7, 2020
57950a2
Ignore failures of RLS on aarch64 Windows
Mark-Simulacrum Nov 17, 2020
483c1a8
Permit unstable features during PGO benchmarks
Mark-Simulacrum Dec 29, 2020
05b6023
Auto merge of #80479 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
bors Dec 29, 2020
bfceef0
Bootstrap from released compiler
Mark-Simulacrum Dec 31, 2020
48233ac
de-stabilize unsized raw ptr methods for Weak
RalfJung Dec 27, 2020
31d03c4
Use package name for top-level directory in bare tarballs
Mark-Simulacrum Dec 26, 2020
8da2799
Make recursion limit fatal in project
matthewjasper Dec 20, 2020
89164cd
Prevent caching projections in the case of cycles
matthewjasper Dec 20, 2020
25b3db3
Auto merge of #80560 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
bors Dec 31, 2020
70fced0
Merge commit '4bd77a19f39165fe9b8be2f7271d4197bd4f42eb' into beta
flip1995 Jan 4, 2021
ff59982
Auto merge of #80680 - flip1995:clippy_backport, r=Mark-Simulacrum
bors Jan 5, 2021
914bed4
[beta] Update cargo
ehuss Jan 13, 2021
ea20aa2
Auto merge of #80975 - ehuss:update-beta-cargo, r=Mark-Simulacrum
bors Jan 14, 2021
78cd953
update RLS and rustfmt
calebcartwright Jan 20, 2021
33b84bb
Auto merge of #81201 - calebcartwright:beta, r=Mark-Simulacrum
bors Jan 20, 2021
59b6b11
Fix handling of malicious Readers in read_to_end
sfackler Jan 11, 2021
2fe7ddc
clean up control flow
sfackler Jan 11, 2021
e73125e
make check a bit more clear
sfackler Jan 11, 2021
2eef2e2
clarify docs a bit
sfackler Jan 11, 2021
44a1f09
bootstrap: extract from any compression algorithm during distcheck
pietroalbini Dec 30, 2020
4e4636d
bootstrap: never delete the tarball temporary directory
pietroalbini Dec 30, 2020
14fa726
bootstrap: change the dist outputs to GeneratedTarball
pietroalbini Dec 30, 2020
13cd768
bootstrap: use the correct paths during ./x.py install
pietroalbini Dec 30, 2020
4050e27
bootstrap: fix x.py install not working with relative prefix
pietroalbini Jan 7, 2021
96a00a9
Update mdbook
ehuss Jan 4, 2021
5a4852a
rustdoc: Render visibilities succinctly
camelid Dec 25, 2020
9c4494c
Fix bugs; fix and add tests
camelid Dec 25, 2020
2ea0fa5
Handle `pub(super)`
camelid Dec 25, 2020
76d2603
Prefer `pub(crate)` over no modifier
camelid Dec 26, 2020
c73576a
Merge `pub-restricted` and `visibility` test
camelid Dec 26, 2020
c7a85ca
Add missing code to `find_closest_parent_module`
camelid Dec 26, 2020
0c127b3
Simplify loop and remove old debugging code
camelid Dec 26, 2020
69e1722
Extract local variable
camelid Dec 26, 2020
e9ae18d
Update `find_nearest_parent_module`
camelid Dec 31, 2020
8f0ce5d
Remove FIXME
camelid Dec 31, 2020
dc7eb41
Small refactor
camelid Dec 31, 2020
0a3048d
Add note on panic behavior
camelid Dec 31, 2020
6ec4c71
Add FIXME for visibility of a module
camelid Dec 31, 2020
d239ea6
Add `@!has` checks to ensure private items don't have `pub`
camelid Dec 31, 2020
1cd0303
Auto merge of #81151 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
bors Jan 20, 2021
f86b143
Auto merge of #81762 - pietroalbini:fix-install-msys2, r=m-ou-se
bors Feb 4, 2021
567eb04
Auto merge of #81055 - matthewjasper:non-fatal-overflow, r=nikomatsakis
bors Jan 28, 2021
f6b8e2b
Rollup merge of #81532 - estebank:ice-ice-baby, r=pnkfelix
m-ou-se Feb 3, 2021
3b03446
Rollup merge of #81556 - nikomatsakis:forbidden-lint-groups-lint, r=p…
m-ou-se Feb 4, 2021
d1eff4c
[beta] Update cargo
ehuss Feb 4, 2021
7906dc0
Rollup merge of #81288 - camelid:fix-trait-item-vis, r=jyn514
jonas-schievink Jan 23, 2021
e364d4a
Auto merge of #81229 - m-ou-se:solaris-workaround, r=pietroalbini
bors Jan 20, 2021
78e57dc
Rollup merge of #81767 - exrook:layout-error-stability, r=Mark-Simula…
m-ou-se Feb 5, 2021
eba5432
Auto merge of #81257 - pnkfelix:issue-80949-short-term-resolution-via…
bors Feb 5, 2021
fc81b7c
Rename `panic_fmt` lint to `non_fmt_panic`.
m-ou-se Feb 2, 2021
2efd070
Auto merge of #81774 - ehuss:beta-backports, r=ehuss
bors Feb 6, 2021
fe8e0c5
backport release notes from master
pietroalbini Feb 8, 2021
94c439b
lexer: Avoid some span arithmetic in `emit_unescape_error`
petrochenkov Jan 24, 2021
2602fa0
this is 1.50.0 stable
pietroalbini Feb 8, 2021
690501e
Auto merge of #81878 - pietroalbini:stable-1.50.0, r=pietroalbini
bors Feb 8, 2021
facc68d
bootstrap: Locate llvm-dwp based on llvm-config bindir
dtolnay Feb 10, 2021
a7f4cce
bootstrap: fix wrong docs installation path
pietroalbini Feb 10, 2021
cb75ad5
Auto merge of #81963 - pietroalbini:stable-1.50.0-pre2, r=pietroalbini
bors Feb 10, 2021
41927a1
Use llvm submodule with Xtensa arch support.
MabezDev Jan 17, 2021
e05a6bc
Teach rustc about the Xtensa arch.
MabezDev Sep 12, 2020
0c11a48
Teach rustc about the Xtensa call ABI.
MabezDev Sep 12, 2020
bc0e24c
Add some Xtensa targets
MabezDev Sep 12, 2020
dc4254e
Make `libstd` compile.
reitermarkus Dec 4, 2019
68c9626
Delete `ext/net.rs`.
reitermarkus Mar 5, 2021
bc4e162
Fix `net.rs`.
reitermarkus Mar 5, 2021
f10b293
Fix `target_family`.
reitermarkus Mar 5, 2021
adee687
Fix compilation.
reitermarkus Mar 5, 2021
620c9d5
`compare_exchange_weak` doesn't work.
reitermarkus Mar 6, 2021
6686577
`memalign` is now implemented.
reitermarkus Mar 6, 2021
de64fd9
Refactor `Condvar`.
reitermarkus Mar 6, 2021
94bdeff
Simplify `process` stubs.
reitermarkus Mar 6, 2021
d045009
Use `debug_assertions`.
reitermarkus Mar 6, 2021
b2c8c70
Update `ned_fd`.
reitermarkus Mar 6, 2021
a44476a
Revert some changes.
reitermarkus Mar 6, 2021
90ba40b
Update formatting.
reitermarkus Mar 7, 2021
8304726
Simplify `thread_local_key`.
reitermarkus Mar 7, 2021
c7379a0
Fix whitespace.
reitermarkus Mar 7, 2021
5b30ae1
Fix `Condvar`.
reitermarkus Mar 7, 2021
ca93ffd
`clock_t` depends on `newlib`.
reitermarkus Mar 11, 2021
d1ec22f
`memalign` depends on `newlib`.
reitermarkus Mar 11, 2021
9add941
Filesystem functions depend on `newlib`.
reitermarkus Mar 11, 2021
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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
url = https://github.com/rust-lang/edition-guide.git
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/rust-lang/llvm-project.git
branch = rustc/11.0-2020-10-12
url = https://github.com/espressif/llvm-project
branch = xtensa_release_11.0.0
[submodule "src/doc/embedded-book"]
path = src/doc/embedded-book
url = https://github.com/rust-embedded/book.git
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1973,9 +1973,9 @@ dependencies = [

[[package]]
name = "mdbook"
version = "0.4.3"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29be448fcafb00c5a8966c4020c2a5ffbbc333e5b96d0bb5ef54b5bd0524d9ff"
checksum = "21251d3eb9ca5e8ac5b73384ddaa483a9bbc7d7dcd656b1fa8f266634810334a"
dependencies = [
"ammonia",
"anyhow",
Expand Down
252 changes: 249 additions & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,249 @@
Version 1.50.0 (2021-02-11)
============================

Language
-----------------------
- [You can now use `const` values for `x` in `[x; N]` array expressions.][79270]
This has been technically possible since 1.38.0, as it was unintentionally stabilized.
- [Assignments to `ManuallyDrop<T>` union fields are now considered safe.][78068]

Compiler
-----------------------
- [Added tier 3\* support for the `armv5te-unknown-linux-uclibceabi` target.][78142]
- [Added tier 3 support for the `aarch64-apple-ios-macabi` target.][77484]
- [The `x86_64-unknown-freebsd` is now built with the full toolset.][79484]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
-----------------------

- [`proc_macro::Punct` now implements `PartialEq<char>`.][78636]
- [`ops::{Index, IndexMut}` are now implemented for fixed sized arrays of any length.][74989]
- [On Unix platforms, the `std::fs::File` type now has a "niche" of `-1`.][74699]
This value cannot be a valid file descriptor, and now means `Option<File>` takes
up the same amount of space as `File`.

Stabilized APIs
---------------

- [`bool::then`]
- [`btree_map::Entry::or_insert_with_key`]
- [`f32::clamp`]
- [`f64::clamp`]
- [`hash_map::Entry::or_insert_with_key`]
- [`Ord::clamp`]
- [`RefCell::take`]
- [`slice::fill`]
- [`UnsafeCell::get_mut`]

The following previously stable methods are now `const`.

- [`IpAddr::is_ipv4`]
- [`IpAddr::is_ipv6`]
- [`Layout::size`]
- [`Layout::align`]
- [`Layout::from_size_align`]
- `pow` for all integer types.
- `checked_pow` for all integer types.
- `saturating_pow` for all integer types.
- `wrapping_pow` for all integer types.
- `next_power_of_two` for all unsigned integer types.
- `checked_power_of_two` for all unsigned integer types.

Cargo
-----------------------

- [Added the `[build.rustc-workspace-wrapper]` option.][cargo/8976]
This option sets a wrapper to execute instead of `rustc`, for workspace members only.
- [`cargo:rerun-if-changed` will now, if provided a directory, scan the entire
contents of that directory for changes.][cargo/8973]
- [Added the `--workspace` flag to the `cargo update` command.][cargo/8725]

Misc
----

- [The search results tab and the help button are focusable with keyboard in rustdoc.][79896]
- [Running tests will now print the total time taken to execute.][75752]

Compatibility Notes
-------------------

- [The `compare_and_swap` method on atomics has been deprecated.][79261] It's
recommended to use the `compare_exchange` and `compare_exchange_weak` methods instead.
- [Changes in how `TokenStream`s are checked have fixed some cases where you could write
unhygenic `macro_rules!` macros.][79472]
- [`#![test]` as an inner attribute is now considered unstable like other inner macro
attributes, and reports an error by default through the `soft_unstable` lint.][79003]
- [Overriding a `forbid` lint at the same level that it was set is now a hard error.][78864]
- [Dropped support for all cloudabi targets.][78439]
- [You can no longer intercept `panic!` calls by supplying your own macro.][78343] It's
recommended to use the `#[panic_handler]` attribute to provide your own implementation.
- [Semi-colons after item statements (e.g. `struct Foo {};`) now produce a warning.][78296]

[74989]: https://github.com/rust-lang/rust/pull/74989
[79261]: https://github.com/rust-lang/rust/pull/79261
[79896]: https://github.com/rust-lang/rust/pull/79896
[79484]: https://github.com/rust-lang/rust/pull/79484
[79472]: https://github.com/rust-lang/rust/pull/79472
[79270]: https://github.com/rust-lang/rust/pull/79270
[79003]: https://github.com/rust-lang/rust/pull/79003
[78864]: https://github.com/rust-lang/rust/pull/78864
[78636]: https://github.com/rust-lang/rust/pull/78636
[78439]: https://github.com/rust-lang/rust/pull/78439
[78343]: https://github.com/rust-lang/rust/pull/78343
[78296]: https://github.com/rust-lang/rust/pull/78296
[78068]: https://github.com/rust-lang/rust/pull/78068
[75752]: https://github.com/rust-lang/rust/pull/75752
[74699]: https://github.com/rust-lang/rust/pull/74699
[78142]: https://github.com/rust-lang/rust/pull/78142
[77484]: https://github.com/rust-lang/rust/pull/77484
[cargo/8976]: https://github.com/rust-lang/cargo/pull/8976
[cargo/8973]: https://github.com/rust-lang/cargo/pull/8973
[cargo/8725]: https://github.com/rust-lang/cargo/pull/8725
[`IpAddr::is_ipv4`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_ipv4
[`IpAddr::is_ipv6`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_ipv6
[`Layout::align`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.align
[`Layout::from_size_align`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.from_size_align
[`Layout::size`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.size
[`Ord::clamp`]: https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html#method.clamp
[`RefCell::take`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.take
[`UnsafeCell::get_mut`]: https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.get_mut
[`bool::then`]: https://doc.rust-lang.org/stable/std/primitive.bool.html#method.then
[`btree_map::Entry::or_insert_with_key`]: https://doc.rust-lang.org/stable/std/collections/btree_map/enum.Entry.html#method.or_insert_with_key
[`f32::clamp`]: https://doc.rust-lang.org/stable/std/primitive.f32.html#method.clamp
[`f64::clamp`]: https://doc.rust-lang.org/stable/std/primitive.f64.html#method.clamp
[`hash_map::Entry::or_insert_with_key`]: https://doc.rust-lang.org/stable/std/collections/hash_map/enum.Entry.html#method.or_insert_with_key
[`slice::fill`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.fill


Version 1.49.0 (2020-12-31)
============================

Language
-----------------------

- [Unions can now implement `Drop`, and you can now have a field in a union
with `ManuallyDrop<T>`.][77547]
- [You can now cast uninhabited enums to integers.][76199]
- [You can now bind by reference and by move in patterns.][76119] This
allows you to selectively borrow individual components of a type. E.g.
```rust
#[derive(Debug)]
struct Person {
name: String,
age: u8,
}

let person = Person {
name: String::from("Alice"),
age: 20,
};

// `name` is moved out of person, but `age` is referenced.
let Person { name, ref age } = person;
println!("{} {}", name, age);
```

Compiler
-----------------------

- [Added tier 1\* support for `aarch64-unknown-linux-gnu`.][78228]
- [Added tier 2 support for `aarch64-apple-darwin`.][75991]
- [Added tier 2 support for `aarch64-pc-windows-msvc`.][75914]
- [Added tier 3 support for `mipsel-unknown-none`.][78676]
- [Raised the minimum supported LLVM version to LLVM 9.][78848]
- [Output from threads spawned in tests is now captured.][78227]
- [Change os and vendor values to "none" and "unknown" for some targets][78951]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
-----------------------

- [`RangeInclusive` now checks for exhaustion when calling `contains` and indexing.][78109]
- [`ToString::to_string` now no longer shrinks the internal buffer in the default implementation.][77997]

Stabilized APIs
---------------

- [`slice::select_nth_unstable`]
- [`slice::select_nth_unstable_by`]
- [`slice::select_nth_unstable_by_key`]

The following previously stable methods are now `const`.

- [`Poll::is_ready`]
- [`Poll::is_pending`]

Cargo
-----------------------
- [Building a crate with `cargo-package` should now be independently reproducible.][cargo/8864]
- [`cargo-tree` now marks proc-macro crates.][cargo/8765]
- [Added `CARGO_PRIMARY_PACKAGE` build-time environment variable.][cargo/8758] This
variable will be set if the crate being built is one the user selected to build, either
with `-p` or through defaults.
- [You can now use glob patterns when specifying packages & targets.][cargo/8752]


Compatibility Notes
-------------------

- [Demoted `i686-unknown-freebsd` from host tier 2 to target tier 2 support.][78746]
- [Macros that end with a semi-colon are now treated as statements even if they expand to nothing.][78376]
- [Rustc will now check for the validity of some built-in attributes on enum variants.][77015]
Previously such invalid or unused attributes could be ignored.
- Leading whitespace is stripped more uniformly in documentation comments, which may change behavior. You
read [this post about the changes][rustdoc-ws-post] for more details.
- [Trait bounds are no longer inferred for associated types.][79904]

Internal Only
-------------
These changes provide no direct user facing benefits, but represent significant
improvements to the internals and overall performance of rustc and
related tools.

- [rustc's internal crates are now compiled using the `initial-exec` Thread
Local Storage model.][78201]
- [Calculate visibilities once in resolve.][78077]
- [Added `system` to the `llvm-libunwind` bootstrap config option.][77703]
- [Added `--color` for configuring terminal color support to bootstrap.][79004]


[75991]: https://github.com/rust-lang/rust/pull/75991
[78951]: https://github.com/rust-lang/rust/pull/78951
[78848]: https://github.com/rust-lang/rust/pull/78848
[78746]: https://github.com/rust-lang/rust/pull/78746
[78376]: https://github.com/rust-lang/rust/pull/78376
[78228]: https://github.com/rust-lang/rust/pull/78228
[78227]: https://github.com/rust-lang/rust/pull/78227
[78201]: https://github.com/rust-lang/rust/pull/78201
[78109]: https://github.com/rust-lang/rust/pull/78109
[78077]: https://github.com/rust-lang/rust/pull/78077
[77997]: https://github.com/rust-lang/rust/pull/77997
[77703]: https://github.com/rust-lang/rust/pull/77703
[77547]: https://github.com/rust-lang/rust/pull/77547
[77015]: https://github.com/rust-lang/rust/pull/77015
[76199]: https://github.com/rust-lang/rust/pull/76199
[76119]: https://github.com/rust-lang/rust/pull/76119
[75914]: https://github.com/rust-lang/rust/pull/75914
[79004]: https://github.com/rust-lang/rust/pull/79004
[78676]: https://github.com/rust-lang/rust/pull/78676
[79904]: https://github.com/rust-lang/rust/issues/79904
[cargo/8864]: https://github.com/rust-lang/cargo/pull/8864
[cargo/8765]: https://github.com/rust-lang/cargo/pull/8765
[cargo/8758]: https://github.com/rust-lang/cargo/pull/8758
[cargo/8752]: https://github.com/rust-lang/cargo/pull/8752
[`slice::select_nth_unstable`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable
[`slice::select_nth_unstable_by`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable_by
[`slice::select_nth_unstable_by_key`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.select_nth_unstable_by_key
[`hint::spin_loop`]: https://doc.rust-lang.org/stable/std/hint/fn.spin_loop.html
[`Poll::is_ready`]: https://doc.rust-lang.org/stable/std/task/enum.Poll.html#method.is_ready
[`Poll::is_pending`]: https://doc.rust-lang.org/stable/std/task/enum.Poll.html#method.is_pending
[rustdoc-ws-post]: https://blog.guillaume-gomez.fr/articles/2020-11-11+New+doc+comment+handling+in+rustdoc

Version 1.48.0 (2020-11-19)
==========================

Expand All @@ -10,7 +256,7 @@ Language
Compiler
--------
- [Stabilised the `-C link-self-contained=<yes|no>` compiler flag.][76158] This tells
`rustc` whether to link its own C runtime and libraries or to rely on a external
`rustc` whether to link its own C runtime and libraries or to rely on a external
linker to find them. (Supported only on `windows-gnu`, `linux-musl`, and `wasi` platforms.)
- [You can now use `-C target-feature=+crt-static` on `linux-gnu` targets.][77386]
Note: If you're using cargo you must explicitly pass the `--target` flag.
Expand Down Expand Up @@ -82,7 +328,7 @@ Compatibility Notes
- [Foreign exceptions are now caught by `catch_unwind` and will cause an abort.][70212]
Note: This behaviour is not guaranteed and is still considered undefined behaviour,
see the [`catch_unwind`] documentation for further information.



Internal Only
Expand All @@ -102,7 +348,7 @@ related tools.
[76030]: https://github.com/rust-lang/rust/pull/76030/
[70212]: https://github.com/rust-lang/rust/pull/70212/
[27675]: https://github.com/rust-lang/rust/issues/27675/
[54121]: https://github.com/rust-lang/rust/issues/54121/
[54121]: https://github.com/rust-lang/rust/issues/54121/
[71274]: https://github.com/rust-lang/rust/pull/71274/
[77386]: https://github.com/rust-lang/rust/pull/77386/
[77153]: https://github.com/rust-lang/rust/pull/77153/
Expand Down
16 changes: 15 additions & 1 deletion compiler/rustc_infer/src/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ impl ProjectionCacheKey<'tcx> {
pub enum ProjectionCacheEntry<'tcx> {
InProgress,
Ambiguous,
Recur,
Error,
NormalizedTy(NormalizedTy<'tcx>),
}
Expand Down Expand Up @@ -143,7 +144,12 @@ impl<'tcx> ProjectionCache<'_, 'tcx> {
"ProjectionCacheEntry::insert_ty: adding cache entry: key={:?}, value={:?}",
key, value
);
let fresh_key = self.map().insert(key, ProjectionCacheEntry::NormalizedTy(value));
let mut map = self.map();
if let Some(ProjectionCacheEntry::Recur) = map.get(&key) {
debug!("Not overwriting Recur");
return;
}
let fresh_key = map.insert(key, ProjectionCacheEntry::NormalizedTy(value));
assert!(!fresh_key, "never started projecting `{:?}`", key);
}

Expand Down Expand Up @@ -197,6 +203,14 @@ impl<'tcx> ProjectionCache<'_, 'tcx> {
assert!(!fresh, "never started projecting `{:?}`", key);
}

/// Indicates that while trying to normalize `key`, `key` was required to
/// be normalized again. Selection or evaluation should eventually report
/// an error here.
pub fn recur(&mut self, key: ProjectionCacheKey<'tcx>) {
let fresh = self.map().insert(key, ProjectionCacheEntry::Recur);
assert!(!fresh, "never started projecting `{:?}`", key);
}

/// Indicates that trying to normalize `key` resulted in
/// error.
pub fn error(&mut self, key: ProjectionCacheKey<'tcx>) {
Expand Down
15 changes: 15 additions & 0 deletions compiler/rustc_lint/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use rustc_session::SessionLintStore;
use rustc_span::lev_distance::find_best_match_for_name;
use rustc_span::{symbol::Symbol, MultiSpan, Span, DUMMY_SP};
use rustc_target::abi::LayoutOf;
use tracing::debug;

use std::cell::Cell;
use std::slice;
Expand Down Expand Up @@ -335,6 +336,20 @@ impl LintStore {
}
}

/// True if this symbol represents a lint group name.
pub fn is_lint_group(&self, lint_name: Symbol) -> bool {
debug!(
"is_lint_group(lint_name={:?}, lint_groups={:?})",
lint_name,
self.lint_groups.keys().collect::<Vec<_>>()
);
let lint_name_str = &*lint_name.as_str();
self.lint_groups.contains_key(&lint_name_str) || {
let warnings_name_str = crate::WARNINGS.name_lower();
lint_name_str == &*warnings_name_str
}
}

/// Checks the name of a lint for its existence, and whether it was
/// renamed or removed. Generates a DiagnosticBuilder containing a
/// warning for renamed and removed lints. This is over both lint
Expand Down
Loading