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 8 pull requests #101508

Merged
merged 79 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
7025502
clippy: make generated code nice to read
kartva Aug 7, 2022
a3fc4db
more matches! sites
kartva Aug 7, 2022
bcab4be
regenerate files with new syntax
kartva Aug 7, 2022
581a01d
Migrate `syntax::make` to use format arg captures
DropDemBits Aug 18, 2022
6669ea8
Leave attrs on the variant, not the extracted struct
DropDemBits Aug 18, 2022
7d77775
Insert newline after extracted struct's attributes
DropDemBits Aug 18, 2022
dbaf2ce
turn `unwrap_or` into `unwrap_or_else` and vice versa
Austaras Aug 26, 2022
0dd9eef
add type check
Austaras Aug 26, 2022
f9c180f
update tests
Austaras Aug 26, 2022
42486b6
change as requested
Austaras Aug 27, 2022
f02cd0a
Auto merge of #13056 - DropDemBits:make-refactors, r=Veykril
bors Aug 29, 2022
66ec636
Highlight namerefs by syntax until proc-macros have been loaded
Veykril Aug 28, 2022
5f132e6
feat: Add a "Unmerge match arm" assist to split or-patterns inside ma…
ChayimFriedman2 Aug 30, 2022
7ecead2
fix: sort and deduplicate auto traits in trait object types
lowr Jul 18, 2022
989b09d
Auto merge of #13145 - ChayimFriedman2:unmerge-match-arm, r=jonas-sch…
bors Aug 30, 2022
45dac9a
Move comments to the extracted struct
DropDemBits Aug 30, 2022
662ab0c
fix: unescape all occurrences of module name in module resolution
lowr Aug 30, 2022
e5e9799
Use type information to deduce the correct type for "Replace turbofis…
ChayimFriedman2 Aug 31, 2022
bcdacfe
Support `?` and `.await` in "Replace turbofish with explicit type"
ChayimFriedman2 Aug 31, 2022
e0e18cc
Auto merge of #13151 - ChayimFriedman2:replace-turbofish-other-type, …
bors Aug 31, 2022
5c0e252
Drop the expander borrow in all control flow paths
Veykril Aug 31, 2022
ef27641
Auto merge of #13154 - Veykril:ty-mac-expander, r=Veykril
bors Aug 31, 2022
b613896
Auto merge of #13149 - lowr:fix/unescape-raw-ident-module-path, r=Vey…
bors Aug 31, 2022
56d8886
Auto merge of #12793 - lowr:fix/12739, r=Veykril
bors Aug 31, 2022
d9e2207
Auto merge of #12963 - DesmondWillowbrook:clippy-matches-sourcegen, r…
bors Aug 31, 2022
43e8d96
change title
Austaras Aug 31, 2022
4661a60
Add convert_two_arm_bool_match_to_matches_macro ide-assists
pocket7878 Aug 12, 2022
a5d2463
fix: Simplify logics to allow two-arm enum match.
pocket7878 Aug 12, 2022
5a1b45d
feature: Simplfy branch check logics
pocket7878 Aug 31, 2022
7464b6d
feature: Check if first_arm bool and second_arm bool is inverted or not.
pocket7878 Aug 31, 2022
cf05b7d
Auto merge of #13051 - DropDemBits:attrs-and-comments-on-enum-variant…
bors Aug 31, 2022
79a578a
Auto merge of #13005 - pocket7878:convert-two-arm-bool-match-to-match…
bors Aug 31, 2022
7f38581
Auto merge of #13120 - Austaras:master, r=jonas-schievink
bors Aug 31, 2022
192a79c
Remove hir::Expr::MacroStmts
Veykril Aug 31, 2022
1a580a3
Implement unstable RFC 1872 `exhaustive_patterns`
iDawer Aug 31, 2022
ee02a47
Remove unnecessary allocations
Veykril Aug 31, 2022
ab068f1
Auto merge of #13156 - Veykril:macro-stmts, r=Veykril
bors Aug 31, 2022
1fa9d5e
Correct visibility check
iDawer Aug 31, 2022
643c3a5
Auto merge of #13134 - Veykril:proc-highlight, r=Veykril
bors Aug 31, 2022
d786a40
Parse TypePathFn with preceding `::`
ChayimFriedman2 Aug 31, 2022
2eec4ed
Lower float literals with underscores
ChayimFriedman2 Sep 1, 2022
d6fc4a9
Simplify breakables handling
Veykril Sep 1, 2022
1e66a5a
Diagnose incorrect continue expressions
Veykril Sep 1, 2022
8110119
Properly handle break resolution inside non-breakable expressions
Veykril Sep 1, 2022
c6b7f45
Don't run `rust-2021-compatibility` lints, our crates are already on …
Veykril Sep 1, 2022
c4445e4
Auto merge of #13165 - Veykril:breakables, r=Veykril
bors Sep 1, 2022
f23114c
Auto merge of #13161 - ChayimFriedman2:pi-is-zero, r=jonas-schievink
bors Sep 1, 2022
93c52e4
Auto merge of #13160 - ChayimFriedman2:parse-parenthesized-type-path-…
bors Sep 1, 2022
61ad33d
internal: ignore failures when publishing to ovsx
matklad Sep 2, 2022
412d614
Auto merge of #13171 - matklad:open-failure, r=lnicola
bors Sep 2, 2022
8ae58b9
Record enabled unstable features into DefMap
iDawer Sep 2, 2022
ffd79c2
Add docs
iDawer Sep 2, 2022
4f8153e
Auto merge of #13167 - iDawer:exhaustive_patterns, r=Veykril
bors Sep 2, 2022
fe0a106
Don't store SyntheticSyntax in the reverse maps in BodySourceMap
Veykril Sep 2, 2022
2bb6635
Auto merge of #13173 - Veykril:synthetic, r=Veykril
bors Sep 2, 2022
8828049
Lift out the module scope into a field in the Resolver
Veykril Sep 2, 2022
f27f98d
Auto merge of #13174 - Veykril:resolver, r=Veykril
bors Sep 2, 2022
894aa0e
Clarify the state of (extern) preludes for block def maps
Veykril Sep 2, 2022
afa374e
Auto merge of #13175 - Veykril:resolver, r=Veykril
bors Sep 2, 2022
020f689
Fix nested break expressions, expecting unknown types
Veykril Sep 3, 2022
8ddb8b7
Auto merge of #13183 - Veykril:break-break, r=Veykril
bors Sep 3, 2022
d7ef3f5
fix: correct broken logic for return complition
matklad Sep 4, 2022
67920f7
Auto merge of #13187 - matklad:return, r=Veykril
bors Sep 4, 2022
fdf56cf
Add test.
cjgillot Sep 5, 2022
774e712
Fix compile errors for uwp-windows-msvc targets
ChrisDenton Sep 6, 2022
3f45dc1
fix RPIT ICE for implicit HRTB when missing dyn
spastorino Sep 6, 2022
9c4fb01
Remove dead broken code from const zst handling in backends
oli-obk Sep 6, 2022
ad275f5
add list of recognized repr attributes to the unrecognized repr error
asquared31415 Sep 6, 2022
4282802
rustdoc: remove unused CSS `#results > table`
notriddle Sep 6, 2022
e1f5d4f
rustdoc: remove outdated CSS `.sub-variant > div > .item-info`
notriddle Sep 6, 2022
d058800
:arrow_up: rust-analyzer
lnicola Sep 6, 2022
631aed8
Rollup merge of #101451 - cjgillot:test-100521, r=TaKO8Ki
JohnTitor Sep 6, 2022
a12e29a
Rollup merge of #101468 - spastorino:fix-ice-rpit-hrtb-without-dyn, r…
JohnTitor Sep 6, 2022
923dae5
Rollup merge of #101481 - ChrisDenton:uwp-fix, r=thomcc
JohnTitor Sep 6, 2022
1d49dce
Rollup merge of #101484 - oli-obk:no_zst, r=eddyb
JohnTitor Sep 6, 2022
f68d05c
Rollup merge of #101486 - asquared31415:invalid_repr_list, r=estebank
JohnTitor Sep 6, 2022
cf41b38
Rollup merge of #101488 - notriddle:notriddle/results-table, r=Guilla…
JohnTitor Sep 6, 2022
1bc6110
Rollup merge of #101491 - notriddle:notriddle/sub-variant-div-item-in…
JohnTitor Sep 6, 2022
6903a84
Rollup merge of #101497 - lnicola:rust-analyzer-2022-09-06, r=lnicola
JohnTitor Sep 6, 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
3 changes: 1 addition & 2 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1561,8 +1561,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {

LifetimeRes::Fresh { param, binder: _ } => {
debug_assert_eq!(lifetime.ident.name, kw::UnderscoreLifetime);
let old_def_id = self.local_def_id(param);
if remapping.get(&old_def_id).is_none() {
if let Some(old_def_id) = self.opt_local_def_id(param) && remapping.get(&old_def_id).is_none() {
let node_id = self.next_node_id();

let new_def_id = self.create_def(
Expand Down
22 changes: 10 additions & 12 deletions compiler/rustc_attr/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1045,18 +1045,16 @@ pub fn parse_repr_attr(sess: &Session, attr: &Attribute) -> Vec<ReprAttr> {
&name,
),
});
} else {
if matches!(
meta_item.name_or_empty(),
sym::C | sym::simd | sym::transparent
) || int_type_of_word(meta_item.name_or_empty()).is_some()
{
recognised = true;
sess.emit_err(session_diagnostics::InvalidReprHintNoValue {
span: meta_item.span,
name: meta_item.name_or_empty().to_ident_string(),
});
}
} else if matches!(
meta_item.name_or_empty(),
sym::C | sym::simd | sym::transparent
) || int_type_of_word(meta_item.name_or_empty()).is_some()
{
recognised = true;
sess.emit_err(session_diagnostics::InvalidReprHintNoValue {
span: meta_item.span,
name: meta_item.name_or_empty().to_ident_string(),
});
}
} else if let MetaItemKind::List(_) = meta_item.kind {
if meta_item.has_name(sym::align) {
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_gcc/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ impl<'gcc, 'tcx> ConstMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
None
}

fn zst_to_backend(&self, _ty: Type<'gcc>) -> RValue<'gcc> {
self.const_undef(self.type_ix(0))
}

fn scalar_to_backend(&self, cv: Scalar, layout: abi::Scalar, ty: Type<'gcc>) -> RValue<'gcc> {
let bitsize = if layout.is_bool() { 1 } else { layout.size(self).bits() };
match cv {
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_llvm/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
})
}

fn zst_to_backend(&self, _llty: &'ll Type) -> &'ll Value {
self.const_undef(self.type_ix(0))
}

fn scalar_to_backend(&self, cv: Scalar, layout: abi::Scalar, llty: &'ll Type) -> &'ll Value {
let bitsize = if layout.is_bool() { 1 } else { layout.size(self).bits() };
match cv {
Expand Down
9 changes: 1 addition & 8 deletions compiler/rustc_codegen_ssa/src/mir/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
) -> Self {
let layout = bx.layout_of(ty);

if layout.is_zst() {
return OperandRef::new_zst(bx, layout);
}

let val = match val {
ConstValue::Scalar(x) => {
let Abi::Scalar(scalar) = layout.abi else {
Expand All @@ -84,10 +80,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
let llval = bx.scalar_to_backend(x, scalar, bx.immediate_backend_type(layout));
OperandValue::Immediate(llval)
}
ConstValue::ZeroSized => {
let llval = bx.zst_to_backend(bx.immediate_backend_type(layout));
OperandValue::Immediate(llval)
}
ConstValue::ZeroSized => return OperandRef::new_zst(bx, layout),
ConstValue::Slice { data, start, end } => {
let Abi::ScalarPair(a_scalar, _) = layout.abi else {
bug!("from_const: invalid ScalarPair layout: {:#?}", layout);
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_codegen_ssa/src/traits/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub trait ConstMethods<'tcx>: BackendTypes {
fn const_data_from_alloc(&self, alloc: ConstAllocation<'tcx>) -> Self::Value;

fn scalar_to_backend(&self, cv: Scalar, layout: abi::Scalar, llty: Self::Type) -> Self::Value;
fn zst_to_backend(&self, llty: Self::Type) -> Self::Value;
fn from_const_alloc(
&self,
layout: TyAndLayout<'tcx>,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,7 @@ impl CheckAttrVisitor<'_> {
E0552,
"unrecognized representation hint"
)
.help("valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`")
.emit();

continue;
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/windows/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ impl File {
mem::size_of::<c::FILE_ATTRIBUTE_TAG_INFO>().try_into().unwrap(),
))?;
if attr_tag.FileAttributes & c::FILE_ATTRIBUTE_REPARSE_POINT != 0 {
reparse_tag = attr_tag.ReparseTag;
attr.reparse_tag = attr_tag.ReparseTag;
}
}
Ok(attr)
Expand Down
9 changes: 0 additions & 9 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,6 @@ h2.location a {
text-align: center;
}

#results > table {
width: 100%;
table-layout: fixed;
}

.content > .example-wrap pre.line-numbers {
position: relative;
-webkit-user-select: none;
Expand Down Expand Up @@ -770,10 +765,6 @@ pre, .rustdoc.source .example-wrap {
margin-left: 24px;
}

.sub-variant > div > .item-info {
margin-top: initial;
}

.content .impl-items .docblock, .content .impl-items .item-info {
margin-bottom: .6em;
}
Expand Down
65 changes: 65 additions & 0 deletions src/test/incremental/issue-100521-change-struct-name-assocty.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// revisions: rpass1 rpass2

pub fn foo() {
bar();
baz::<()>();
}

fn bar()
where
<() as Table>::AllColumns:,
{
}

fn baz<W>()
where
W: AsQuery,
<W as AsQuery>::Query:,
{
}

trait AsQuery {
type Query;
}

trait UnimplementedTrait {}

impl<T> AsQuery for T
where
T: UnimplementedTrait,
{
type Query = ();
}

struct Wrapper<Expr>(Expr);

impl<Ret> AsQuery for Wrapper<Ret> {
type Query = ();
}

impl AsQuery for ()
where
Wrapper<<() as Table>::AllColumns>: AsQuery,
{
type Query = ();
}

trait Table {
type AllColumns;
}

#[cfg(rpass1)]
impl Table for () {
type AllColumns = Checksum1;
}
#[cfg(rpass1)]
struct Checksum1;

#[cfg(rpass2)]
impl Table for () {
type AllColumns = Checksum2;
}
#[cfg(rpass2)]
struct Checksum2;

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0277]: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied
--> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:13
|
LL | fn ice() -> impl AsRef<Fn(&())> {
| ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not implemented for `()`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:24
|
LL | fn ice() -> impl AsRef<Fn(&())> {
| ^^^^^^^
|
help: add `dyn` keyword before this trait
|
LL - fn ice() -> impl AsRef<Fn(&())> {
LL + fn ice() -> impl AsRef<dyn Fn(&())> {
|

error[E0277]: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied
--> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:13
|
LL | fn ice() -> impl AsRef<Fn(&())> {
| ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not implemented for `()`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0782.
For more information about an error, try `rustc --explain E0277`.
12 changes: 12 additions & 0 deletions src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// revisions: edition2015 edition2021
//[edition2021]edition:2021

#![allow(warnings)]

fn ice() -> impl AsRef<Fn(&())> {
//~^ ERROR: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied [E0277]
//[edition2021]~| ERROR: trait objects must include the `dyn` keyword [E0782]
todo!()
}

fn main() {}
4 changes: 4 additions & 0 deletions src/test/ui/issues/issue-43988.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ error[E0552]: unrecognized representation hint
|
LL | #[repr(nothing)]
| ^^^^^^^
|
= help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`

error[E0552]: unrecognized representation hint
--> $DIR/issue-43988.rs:18:12
|
LL | #[repr(something_not_real)]
| ^^^^^^^^^^^^^^^^^^
|
= help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`

error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43988.rs:30:5
Expand Down
17 changes: 17 additions & 0 deletions src/test/ui/repr/invalid_repr_list_help.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#![crate_type = "lib"]

#[repr(uwu)] //~ERROR: unrecognized representation hint
pub struct OwO;

#[repr(uwu = "a")] //~ERROR: unrecognized representation hint
pub struct OwO2(i32);

#[repr(uwu(4))] //~ERROR: unrecognized representation hint
pub struct OwO3 {
x: i32,
}

#[repr(uwu, u8)] //~ERROR: unrecognized representation hint
pub enum OwO4 {
UwU = 1,
}
35 changes: 35 additions & 0 deletions src/test/ui/repr/invalid_repr_list_help.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
error[E0552]: unrecognized representation hint
--> $DIR/invalid_repr_list_help.rs:3:8
|
LL | #[repr(uwu)]
| ^^^
|
= help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`

error[E0552]: unrecognized representation hint
--> $DIR/invalid_repr_list_help.rs:6:8
|
LL | #[repr(uwu = "a")]
| ^^^^^^^^^
|
= help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`

error[E0552]: unrecognized representation hint
--> $DIR/invalid_repr_list_help.rs:9:8
|
LL | #[repr(uwu(4))]
| ^^^^^^
|
= help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`

error[E0552]: unrecognized representation hint
--> $DIR/invalid_repr_list_help.rs:14:8
|
LL | #[repr(uwu, u8)]
| ^^^
|
= help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0552`.
Loading