Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
19645ac
Add Result::{ok, err, and, or, unwrap_or} as const
clarfonthey Dec 29, 2021
24fe35a
Remove argument from closure in thread::Scope::spawn.
m-ou-se Mar 3, 2022
6b46a52
Fix doctests.
m-ou-se Mar 3, 2022
700ec66
Emit `unused_attributes` if a level attr only has a reason
xFrednet Mar 3, 2022
86b4658
Generalize `get_nullable_type` to allow types where null is all-ones.
sunfishcode Mar 3, 2022
9099353
Use '_ for irrelevant lifetimes in Debug impl.
m-ou-se Mar 4, 2022
fbd4cfa
diagnostics: only talk about `Cargo.toml` if running under Cargo
notriddle Mar 7, 2022
776be7e
promot debug_assert to assert
kckeiks Mar 7, 2022
a3d269e
Use `f` instead of `|| f()`.
m-ou-se Mar 7, 2022
02a3830
When encountering a match expr with no arms, suggest it
estebank Dec 16, 2021
2383858
When finding a match expr with a single arm that requires more, sugge…
estebank Dec 16, 2021
084ca79
When finding a match expr with multiple arms that requires more, sugg…
estebank Dec 16, 2021
ab4feea
Point at uncovered variants in enum definition in `note` instead of a…
estebank Dec 16, 2021
6f45f73
Change wording of suggestion to add missing `match` arm
estebank Dec 16, 2021
a3158c7
:arrow_up: rust-analyzer
lnicola Mar 8, 2022
e3ea69f
Rollup merge of #91993 - estebank:match-span-suggestion, r=oli-obk
matthiaskrgr Mar 8, 2022
e22331c
Rollup merge of #92385 - clarfonthey:const_option, r=fee1-dead
matthiaskrgr Mar 8, 2022
aec535f
Rollup merge of #94559 - m-ou-se:thread-scope-spawn-closure-without-a…
matthiaskrgr Mar 8, 2022
83ed227
Rollup merge of #94580 - xFrednet:55112-only-reason-in-lint-attr, r=lcnr
matthiaskrgr Mar 8, 2022
e4a3627
Rollup merge of #94586 - sunfishcode:sunfishcode/io-lifetimes-tests, …
matthiaskrgr Mar 8, 2022
98d027c
Rollup merge of #94708 - notriddle:notriddle/cargo-toml-warning, r=lcnr
matthiaskrgr Mar 8, 2022
a077e44
Rollup merge of #94712 - kckeiks:remove-rwlock-read-error-assumption,…
matthiaskrgr Mar 8, 2022
b879216
Rollup merge of #94726 - lnicola:rust-analyzer-2022-03-08, r=lnicola
matthiaskrgr Mar 8, 2022
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
6 changes: 3 additions & 3 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,17 +606,17 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
rustc_attr!(
rustc_layout_scalar_valid_range_start, Normal, template!(List: "value"), ErrorFollowing,
"the `#[rustc_layout_scalar_valid_range_start]` attribute is just used to enable \
niche optimizations in libcore and will never be stable",
niche optimizations in libcore and libstd and will never be stable",
),
rustc_attr!(
rustc_layout_scalar_valid_range_end, Normal, template!(List: "value"), ErrorFollowing,
"the `#[rustc_layout_scalar_valid_range_end]` attribute is just used to enable \
niche optimizations in libcore and will never be stable",
niche optimizations in libcore and libstd and will never be stable",
),
rustc_attr!(
rustc_nonnull_optimization_guaranteed, Normal, template!(Word), WarnFollowing,
"the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable \
niche optimizations in libcore and will never be stable",
niche optimizations in libcore and libstd and will never be stable",
),

// ==========================================================================
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_lint/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,9 @@ crate fn repr_nullable_ptr<'tcx>(
let field_ty_abi = &cx.layout_of(field_ty).unwrap().abi;
if let Abi::Scalar(field_ty_scalar) = field_ty_abi {
match (field_ty_scalar.valid_range.start, field_ty_scalar.valid_range.end) {
(0, _) => unreachable!("Non-null optimisation extended to a non-zero value."),
(0, x) if x == field_ty_scalar.value.size(&cx.tcx).unsigned_int_max() - 1 => {
return Some(get_nullable_type(cx, field_ty).unwrap());
}
(1, _) => {
return Some(get_nullable_type(cx, field_ty).unwrap());
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/feature-gates/feature-gate-rustc-attrs-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

#[rustc_variance] //~ ERROR the `#[rustc_variance]` attribute is just used for rustc unit tests and will never be stable
#[rustc_error] //~ ERROR the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable
#[rustc_nonnull_optimization_guaranteed] //~ ERROR the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable niche optimizations in libcore and will never be stable
#[rustc_nonnull_optimization_guaranteed] //~ ERROR the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable niche optimizations in libcore and libstd and will never be stable

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LL | #[rustc_error]
|
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable

error[E0658]: the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable niche optimizations in libcore and will never be stable
error[E0658]: the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable niche optimizations in libcore and libstd and will never be stable
--> $DIR/feature-gate-rustc-attrs-1.rs:5:1
|
LL | #[rustc_nonnull_optimization_guaranteed]
Expand Down