Skip to content

visit enum init when the enum variable doesn't have any parameters #102984

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 358 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
358 commits
Select commit Hold shift + click to select a range
35a04bd
Use `tidy-alphabetical` in the compiler
Noratrieb Oct 5, 2022
a7ccf16
Error if tidy-alphabetical-end was not found
Noratrieb Oct 7, 2022
ba9d27a
Show command line arguments
flba-eb Oct 12, 2022
7799078
Apply suggestions from code review
WaffleLapkin Oct 12, 2022
8914cf0
link lint function with `decorate` function param to `struct_lint_level`
WaffleLapkin Oct 12, 2022
8722e9f
add test for issue 102964
Rageking8 Oct 12, 2022
2590baf
Set opt-level = 1 on dev profile
lnicola Oct 12, 2022
8ba47d9
Avoid format! in favor of to_string
lnicola Oct 12, 2022
2a835c2
Add broken test for AFIT with RPITIT
compiler-errors Oct 5, 2022
51ad577
fix small word dupe typos
Rageking8 Oct 12, 2022
1af8fea
Cast runnableEnv items to string
HKalbasi Oct 12, 2022
83c6da7
rustdoc: merge separate `.item-info` CSS
notriddle Oct 12, 2022
f6d6929
ADD - IntoDiagnostic conformance for TargetDataLayoutErrors in rustc_…
JhonnyBillM Oct 5, 2022
ed363be
UPDATE - Move IntoDiagnosticArg implementations to diagnostic_impls file
JhonnyBillM Oct 12, 2022
d5335bc
tidy: error if a lang feature is already present
est31 Oct 12, 2022
045d38f
fix formatting
HKalbasi Oct 12, 2022
7d84ba5
Add a fixme
eholk Oct 12, 2022
6a41232
expand documentation on type conversion w.r.t. `UnsafeCell`
Pointerbender Oct 12, 2022
284f60d
Let chains should still drop temporaries
nathanwhit Oct 12, 2022
da2e349
library: update stdarch submodule
luojia65 Oct 11, 2022
9af4b2f
Sort elaborated existential predicates in object_ty_for_trait
compiler-errors Oct 12, 2022
a281500
Print RPITIT verbosely if -Zverbose
compiler-errors Oct 10, 2022
4a380ac
Delay intrinsic call until after we've determined the callee is a fun…
compiler-errors Oct 13, 2022
5b0de03
rustdoc: don't ICE on `TyKind::Typeof`
WaffleLapkin Oct 13, 2022
3cc18d7
resolve: Add some asserts for unexpected lifetime rib combinations
petrochenkov Oct 9, 2022
bf335c1
resolve: Remove redundant item lifetime ribs
petrochenkov Oct 10, 2022
b03fdfa
resolve: Regroup lifetime rib kinds to account for their purpose
petrochenkov Oct 10, 2022
807f3da
std: use `sync::Mutex` for internal statics
joboet Sep 3, 2022
9f53b06
Run analysis-stats on CI
lnicola Oct 13, 2022
2d9f2c5
Add suggestion to the "missing native library" error
wesleywiser Oct 13, 2022
0bda3cc
sync thread_local key conditions exactly with what the macro uses
RalfJung Oct 7, 2022
2a22ba4
smarter way to avoid 'unused' warning when building for tests
RalfJung Oct 8, 2022
16010e5
Update browser-ui-test version to 0.12.3
GuillaumeGomez Oct 13, 2022
163a212
Improve code for unsafe-fn rustdoc GUI test
GuillaumeGomez Oct 13, 2022
8bf8477
Add test for issue 102986
WaffleLapkin Oct 13, 2022
84d130e
Move some tests to more reasonable directories
c410-f3r Oct 13, 2022
b8311cb
Add new bootstrap entrypoints to triagebot
Noratrieb Oct 13, 2022
7e99639
Ensure enum cast moves
nbdd0121 Oct 13, 2022
82b18cc
replace ReErased with fresh region vars in opaque types
aliemjay Oct 13, 2022
a13a5b1
fix a typo
whentojump Oct 13, 2022
642a1ae
Add test for issue 102389
nbdd0121 Oct 13, 2022
401dbbc
Bless tests
nbdd0121 Oct 13, 2022
2016b25
Fix test
nbdd0121 Oct 13, 2022
a7be8ad
Report duplicate definition in impls with overlap check.
cjgillot Aug 13, 2022
b0ca1db
Make overlapping_impls non-generic
camsteffen Oct 11, 2022
3800261
Add links to relevant pages to find constraint information
GuillaumeGomez Oct 13, 2022
e996d55
Adding fuchsia-ignore and needs-unwind to compiler test cases
andrewpollack Oct 13, 2022
03b1f82
rustdoc: remove unused CSS `.search-container > *`
notriddle Oct 13, 2022
7706b41
Suppress irrefutable let patterns lint for prefixes in match guards
est31 Oct 13, 2022
593cc5f
Lower condition directly from AST to HIR
nathanwhit Oct 14, 2022
dda3fe7
Validate MIR in the `drop_order` test
nathanwhit Oct 14, 2022
ffb0938
Update pkg-config
alyssais Oct 14, 2022
32ae542
Make dyn* cast into a coercion
compiler-errors Sep 14, 2022
1943888
check if the self type is `ty::Float` before getting second substs
TaKO8Ki Oct 13, 2022
97d519d
normalize stderr
TaKO8Ki Oct 13, 2022
0fcd180
Allow dyn* upcasting
compiler-errors Sep 14, 2022
7cd8099
more dupe word typos
Rageking8 Oct 13, 2022
1aa87db
float and int vars are trivially copy
compiler-errors Oct 5, 2022
c2ccf0b
Add test
compiler-errors Oct 5, 2022
24d6b1c
Remove CastCheckResult since it's unused
compiler-errors Sep 14, 2022
bf5eb88
Address nits, add test for implicit dyn-star coercion without feature…
compiler-errors Oct 14, 2022
6abde59
checktools: fix comments
RalfJung Oct 14, 2022
985b584
Revert "fix: in VSCode, correctly resolve relative paths to errors"
jonas-schievink Oct 14, 2022
3d7a9c8
wasm-ignore some tests that access thread-local private details
RalfJung Oct 14, 2022
cdf6163
Require lifetime bounds for opaque types in order to allow hidden typ…
oli-obk Sep 28, 2022
5985ed4
Update cargo
weihanglo Oct 14, 2022
94ddc34
Add missing checks for `doc(cfg_hide(...))` attribute
GuillaumeGomez Oct 12, 2022
4870e98
Add UI test for invalid `doc(cfg_hide(...))` attributes
GuillaumeGomez Oct 12, 2022
564aa1b
remove leading newlines from integer primitive doc examples
Oct 14, 2022
90e66a5
Update browser-ui-test version to fix some flaky tests
GuillaumeGomez Oct 14, 2022
d03ef72
Tweak grammar
joshtriplett Oct 14, 2022
9f9f60e
Clean up rust-logo rustdoc GUI test
GuillaumeGomez Oct 14, 2022
2377701
Bump Swatinem/rust-cache to move off Node 12
lnicola Oct 14, 2022
23e4d63
Fix `Duration::{try_,}from_secs_f{32,64}(-0.0)`
beetrees Oct 14, 2022
a8b4228
Bugfix: keep TLS data in sync
raoulstrackx Oct 13, 2022
5357db9
Set a timeout when publishing to OVSX
lnicola Oct 14, 2022
7dfa65b
remove no_core feature
TaKO8Ki Oct 14, 2022
4b8e4ce
Add some tidy-alphabetical
Noratrieb Oct 14, 2022
866de5b
Also run alphabetical check in src and library
Noratrieb Oct 14, 2022
fe50270
Sort target features alphabetically
Noratrieb Oct 14, 2022
dd1a767
Remove unsued variable in query macro
Noratrieb Oct 10, 2022
b93a08c
Get rid of `rustc_query_description!`
Noratrieb Oct 10, 2022
bbc93dc
Remove the `describe` method from the `QueryDescription` trait
Noratrieb Oct 13, 2022
e880a7e
Add `IsTerminal` trait to determine if a descriptor or handle is a te…
joshtriplett Jun 12, 2022
f3d150d
Make is_terminal fail fast if a process has no console at all
joshtriplett Jun 20, 2022
308c65e
Rewrite FILE_NAME_INFO handling to avoid enlarging slice reference
joshtriplett Aug 24, 2022
3870a7b
Use Align8 to avoid misalignment if the allocator or Vec doesn't alig…
joshtriplett Sep 9, 2022
3b73826
The illumos linker does not support --strip-debug
citrus-it Sep 28, 2022
0379e24
Bump anyhow, arbitrary, itertools, semver, serde
lnicola Oct 3, 2022
e4b36f1
Bump smallvec
lnicola Oct 6, 2022
4a71bf7
Bump tracing
lnicola Oct 8, 2022
22e32fb
Bump home
lnicola Oct 15, 2022
7265365
Bump dashmap
lnicola Oct 15, 2022
414e277
Bump libc
lnicola Oct 15, 2022
e6a384b
Bump url
lnicola Oct 15, 2022
1f11fb7
Surround type with backticks
Oct 15, 2022
2c78c9d
Bump rowan
lnicola Oct 15, 2022
c5e49e0
Bump mimalloc
lnicola Oct 15, 2022
28e233a
Bump pulldown-cmark-to-cmark
lnicola Oct 15, 2022
3031bde
Bump proc-macro2
lnicola Oct 15, 2022
205b5d1
Bump notify
lnicola Oct 15, 2022
0486547
Bump the rest of the deps
lnicola Oct 15, 2022
3270dab
Add new license
lnicola Oct 15, 2022
d5e8c6a
Bump actions/setup-node
lnicola Oct 15, 2022
d866654
Fix display of settings page
GuillaumeGomez Oct 15, 2022
df478d2
Add more GUI tests for settings page
GuillaumeGomez Oct 15, 2022
a152749
pretty: fix to print some lifetimes on HIR pretty-print
ohno418 Oct 14, 2022
17534db
Mark derived StructuralEq as automatically derived.
cjgillot Oct 15, 2022
4dad56f
Documentation BTreeMap::append's behavior for already existing keys
phimuemue Oct 15, 2022
3127f2a
fix #13105: Ignore auto-import assist on parameter names
volsa Oct 15, 2022
355f10e
Fix subst issues with RPITIT
compiler-errors Sep 26, 2022
125db00
Add test
compiler-errors Sep 27, 2022
c01e266
Equate full fn signatures to infer all region variables
compiler-errors Oct 10, 2022
16cec9c
typos
compiler-errors Oct 15, 2022
69b7503
linker: Fix weak lang item linking with combination windows-gnu + LLD…
petrochenkov Oct 15, 2022
6687304
rustdoc: remove unused HTML class `sidebar-title`
notriddle Oct 15, 2022
c957abb
rustdoc: make the help button a link to a page
notriddle Oct 14, 2022
4a1d65c
rustdoc: fix Ctrl-Click on help and settings links
notriddle Oct 15, 2022
eee4c43
rustdoc: update test cases for `.sidebar-title` -> `.sidebar-elems h3`
notriddle Oct 15, 2022
25da206
rustdoc: add test cases for links inside the help popover
notriddle Oct 15, 2022
963de29
resolve: Shadow erroneous glob imports with erroneous single imports
petrochenkov Oct 15, 2022
b20e2cd
More slice::partition_point examples
scottmcm Sep 30, 2022
cb73563
Add MaybeUninit array transpose impls
SUPERCILEX Oct 15, 2022
a33e46e
rustdoc: make help button a no-op when on help page
notriddle Oct 16, 2022
82a5103
PhantomData: inline a macro that is used only once
RalfJung Oct 16, 2022
258ce6a
Account for hygiene when suggesting typos.
cjgillot Oct 16, 2022
d9e8d2c
Point to shadowed name when it exists.
cjgillot Oct 16, 2022
2641bb6
Update guide.md to reflect support for proc-macros
Veykril Oct 16, 2022
4b6046a
Bump chalk to 0.86
lowr Oct 13, 2022
fb4030b
Diagnose incorrect usages of the question mark operator
Veykril Oct 5, 2022
cf1ae93
Update browser-ui-test version to 0.12.5
GuillaumeGomez Oct 16, 2022
5b64956
Clean up anchors.goml rustdoc GUI test
GuillaumeGomez Oct 16, 2022
46bb2b9
fix `own_substs` ICE
TaKO8Ki Oct 16, 2022
9750e30
fix typo
RalfJung Oct 16, 2022
fb3e2d6
Clarify the possible return values of len_utf16
Oct 16, 2022
ed75f9e
update link in syntax.md
zyctree Oct 16, 2022
9445cea
rustdoc: Do not expect `doc(primitive)` modules to always exist
petrochenkov Oct 16, 2022
f0b6ff9
update link in syntax.md
zyctree Oct 16, 2022
bb6317a
rustdoc: Process extern impls in all loaded crates
petrochenkov Oct 16, 2022
b287dca
Populate effective visibilities in 'rustc_resolve'
Bryanskiy Sep 25, 2022
6ea2112
Support DirEntry metadata calls in miri
SUPERCILEX Oct 15, 2022
7b7964b
Don't consider `Let` exprs terminating scopes
nathanwhit Oct 14, 2022
04315e8
trivial fix for comments feedback
chenyukang Oct 17, 2022
606dd9b
Make transpose const and inline
SUPERCILEX Oct 16, 2022
177761c
rustdoc: remove unused `.sub-logo-container` DOM on non-source pages
notriddle Oct 16, 2022
ffc5ca5
rustdoc: clean up `.sub-logo-container` CSS
notriddle Oct 16, 2022
21aa883
Fix types in documentation for Alignment::as_usize and Alignmnet::as_…
tmccombs Oct 17, 2022
f65ed38
Duplicate comment in mod.rs
smoelius Oct 17, 2022
4cf5497
mir constants: type traversing bye bye
lcnr Sep 27, 2022
a57f64b
rm `try_normalize_mir_const_after_erasing_regions`
lcnr Sep 29, 2022
42deac7
add inline to `TrivialTypeTraversalImpls`
lcnr Oct 5, 2022
55e183b
macros: support doc comments in diag derives
davidtwco Oct 14, 2022
7e72c46
macros: allow subdiagnostic-kind-less variants
davidtwco Oct 14, 2022
5ec2c64
macros: fully specify path to `Fn`
davidtwco Oct 14, 2022
5c93a98
ast_lowering: use derive more
davidtwco Oct 14, 2022
34d1538
ast_passes: use derive more
davidtwco Oct 14, 2022
c289c53
lint: use derive more
davidtwco Oct 14, 2022
4718d8c
session: use derive more
davidtwco Oct 14, 2022
ebecde3
infer: use derive more
davidtwco Oct 14, 2022
cc8905f
Make diagnostic for unsatisfied Termination bounds more precise
fmease Oct 17, 2022
0b62b50
Update browser-ui-test version to 0.12.6
GuillaumeGomez Oct 17, 2022
35660c7
Use named arguments to make test clearer
GuillaumeGomez Oct 17, 2022
4509b50
Allow `Vec::leak` with `no_global_oom_handling`
ChrisDenton Oct 17, 2022
3924d56
Fix typo in `ReverseSearcher` docs
Oct 17, 2022
f310f79
Remove the redundant `Some(try_opt!(..))` in `checked_pow`
cuviper Oct 17, 2022
dceeac9
rustdoc: factor JS mobile scroll lock into its own function
notriddle Oct 17, 2022
16bdec8
rustdoc: remove redundant CSS on `#copy-path`
notriddle Oct 17, 2022
f32dd6d
Fix the bug of next_point in span
chenyukang Oct 17, 2022
07688e3
Remove execute bit from lock file permissions
Oct 1, 2022
8ee397b
rustdoc: remove redundant CSS `#crate-search { border-radius }`
notriddle Oct 17, 2022
2313006
Remove all uses of array_assume_init
SUPERCILEX Oct 17, 2022
a69c357
Stabilize asm_sym
Amanieu Oct 17, 2022
11eca93
add a benchmark for slice_iter.copied().array_chunks()
the8472 Oct 17, 2022
9a6d175
Remove `RunCompiler::emitter`.
nnethercote Oct 12, 2022
5fb5e1a
rustdoc: remove CSS `@media (min-width: 701px)`
notriddle Oct 17, 2022
0f3fba5
rustdoc: change mobile breakpoint to match CSS
notriddle Oct 17, 2022
199cfd8
Tweak `deriving-all-codegen.rs`.
nnethercote Oct 18, 2022
e2be7ad
Fix `TyKind::is_simple_path`.
nnethercote Oct 18, 2022
a696b6f
partially fix src/test/run-make/coverage-reports when cross-compiling
pietroalbini Sep 27, 2022
05970d2
handle core dumps output in qemu user mode
pietroalbini Oct 10, 2022
512bc6e
Clean up code-color and headers-color rustdoc GUI tests
GuillaumeGomez Oct 18, 2022
2e43ba2
Stabilize proc_macro::Span::source_text
est31 Oct 18, 2022
991cb49
Clean up query descriptions
Noratrieb Oct 17, 2022
4434a07
Add some more autolabels
jyn514 Oct 18, 2022
cdf11b0
Retrieve LLVM version from llvm-filecheck binary if it is not set yet
GuillaumeGomez Oct 18, 2022
9b8e754
rustdoc: remove class name `location` from sidebar sibling nav
notriddle Oct 18, 2022
d1acefa
Clean up rustdoc startup.
nnethercote Oct 7, 2022
be6366f
Merge `main_options` into `main_args`.
nnethercote Oct 7, 2022
3e7300a
Inline and remove `scoped_thread`.
nnethercote Oct 7, 2022
ecdddfc
Reduce visibility of some functions.
nnethercote Oct 7, 2022
652d248
Inline and remove `create_compiler_and_run`.
nnethercote Oct 7, 2022
009998e
Apply `Lrc` later to `sess` and `codegen_backend`.
nnethercote Oct 7, 2022
d5a3dbf
Replace a `spawn_unchecked` with `spawn_scoped`.
nnethercote Oct 7, 2022
ff364d7
Use `interface::run_compiler` for `markdown::render`.
nnethercote Oct 16, 2022
fceb793
Avoid cloning `RenderOptions`.
nnethercote Oct 16, 2022
e83b282
Consider patterns in fn params in an `Elided(Infer)` lifetime rib.
cjgillot Oct 18, 2022
1c25f94
specialize slice_iter.copied().next_chunk()
the8472 Oct 17, 2022
a06a723
Suggest calling ctor when trait is unimplemented
compiler-errors Oct 9, 2022
24143a0
Use predicate_must_hold_modulo_regions
compiler-errors Oct 9, 2022
91fcac9
Standardize arg suggestions between typeck and trait selection
compiler-errors Oct 9, 2022
9417950
Generalize call suggestion for unsatisfied predicate
compiler-errors Oct 9, 2022
db4623e
fix `SelfVisitor::is_self_ty` ICE
TaKO8Ki Oct 19, 2022
3ce4bad
instantiate -> construct
compiler-errors Oct 19, 2022
fe370bc
Use already checked RHS ty for LHS deref suggestions
compiler-errors Oct 19, 2022
e487373
Clarify `run_in_thread_pool_with_globals`.
nnethercote Oct 9, 2022
75b7451
Add a comment to `Compiler`.
nnethercote Oct 11, 2022
d720ff5
Update browser-ui-test version to 0.12.7
GuillaumeGomez Oct 19, 2022
cb51ea0
Clean up codeblock-tooltip rustdoc-gui test
GuillaumeGomez Oct 19, 2022
cad39d5
Split is_stable from rustc_target::spec::abi::is_enabled.
m-ou-se Oct 19, 2022
3ac9d59
Allow #[unstable] impls for fn() with unstable abi.
m-ou-se Oct 19, 2022
0b3de66
Add test.
m-ou-se Oct 19, 2022
d6a99db
Use Set instead of Vec in transitive_relation
Noratrieb Oct 18, 2022
187e194
Add test for #[unstable] impl for fn() -> !.
m-ou-se Oct 19, 2022
1e3c901
Allow #[unstable] impl for fn() -> UnstableType.
m-ou-se Oct 19, 2022
aca30d0
mark rust-analyzer as a host-only tool
pietroalbini Oct 19, 2022
a2b5d52
Add testcase for next_point, fix more trivial issues in find_width_of…
chenyukang Oct 19, 2022
83d4980
Fix regression in item-decl highlighting
GuillaumeGomez Oct 19, 2022
37d764e
rustdoc: move `setting-line` color CSS to settings.css
notriddle Oct 19, 2022
0b95d0b
Don't hash non-fresh Ty::Infer or RegionKind::Infer
compiler-errors Oct 19, 2022
da22e65
Make ClosureOutlivesRequirement not rely on an unresolved type
compiler-errors Oct 19, 2022
d582e55
Don't call `own_existential_vtable_entries` on unresolved trait ref
compiler-errors Oct 19, 2022
6f62364
Deny const variables as well
compiler-errors Oct 19, 2022
d98e7df
Fixup a few tests needing asm support
cuviper Oct 19, 2022
49b7980
Make miri read_dir test a little more robust
SUPERCILEX Oct 19, 2022
05037c0
Add regression test for item-decl highlighting
GuillaumeGomez Oct 19, 2022
74c6eb8
Extract orig_opt_local_def_id as a function
spastorino Oct 19, 2022
aef75d1
Do anonymous lifetimes remapping correctly for nested rpits
spastorino Oct 18, 2022
e942bdc
rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`
notriddle Oct 19, 2022
be7e80b
Remove extra spaces
clubby789 Oct 19, 2022
c68e9f2
Erase regions before checking for default in uninitialized binding error
compiler-errors Oct 19, 2022
21b2597
Adjusting test to needs-unwind, with linking issue
andrewpollack Oct 19, 2022
74ee999
Fixed docs typo in `library/std/src/time.rs`
johnmatthiggins Oct 20, 2022
87edf20
check if impl_self is `Some`
TaKO8Ki Oct 20, 2022
d55df4f
Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` i…
thomcc Oct 20, 2022
687db5a
Implement assertions and fixes to not emit empty spans without sugges…
kper Oct 11, 2022
731f805
+/- shortcut now only expand/collapse, not both
GuillaumeGomez Oct 20, 2022
24d41d2
Add GUI tests for collapse/expand actions
GuillaumeGomez Oct 20, 2022
00fd02c
fix typo
cuishuang Oct 20, 2022
51df6cc
Mark `std::os::wasi::io::AsFd` etc. as stable.
sunfishcode Oct 20, 2022
f90a574
rustc_hir_typeck: move whole files
lcnr Oct 20, 2022
521ee23
rustc_hir_typeck: fix paths and partially mv files
lcnr Oct 20, 2022
299f7d7
rustc_hir_typeck: fix clippy
lcnr Oct 20, 2022
904437c
add increased recursion limit
lcnr Oct 20, 2022
e84fba4
no test in testsuite label
compiler-errors Oct 20, 2022
b216d30
interpret: remove an incorrect assertion
RalfJung Oct 20, 2022
1213363
Elaborate supertrait bounds when triggering unused_must_use on impl T…
compiler-errors Sep 25, 2022
9dee8d9
Improve "`~const` is not allowed here" message
fee1-dead Oct 20, 2022
9cf2ada
rustdoc: improve appearance of source page navigation bar
notriddle Oct 20, 2022
4b3a5fa
Make the whole `std::os::wasi::io` module stable.
sunfishcode Oct 20, 2022
2b458fe
update doc links
lcnr Oct 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 33 additions & 6 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ dependencies = [
"cargo-test-macro",
"cargo-test-support",
"cargo-util",
"clap 4.0.9",
"clap 4.0.15",
"crates-io",
"curl",
"curl-sys",
Expand Down Expand Up @@ -439,7 +439,7 @@ dependencies = [

[[package]]
name = "cargo-util"
version = "0.2.1"
version = "0.2.2"
dependencies = [
"anyhow",
"core-foundation",
Expand Down Expand Up @@ -602,9 +602,9 @@ dependencies = [

[[package]]
name = "clap"
version = "4.0.9"
version = "4.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30607dd93c420c6f1f80b544be522a0238a7db35e6a12968d28910983fee0df0"
checksum = "6bf8832993da70a4c6d13c581f4463c2bdda27b9bf1c5498dc4365543abe6d6f"
dependencies = [
"atty",
"bitflags",
Expand Down Expand Up @@ -2652,9 +2652,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"

[[package]]
name = "pkg-config"
version = "0.3.18"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"

[[package]]
name = "polonius-engine"
Expand Down Expand Up @@ -3568,6 +3568,32 @@ dependencies = [
"rustc_target",
]

[[package]]
name = "rustc_hir_typeck"
version = "0.1.0"
dependencies = [
"rustc_ast",
"rustc_data_structures",
"rustc_errors",
"rustc_graphviz",
"rustc_hir",
"rustc_hir_analysis",
"rustc_hir_pretty",
"rustc_index",
"rustc_infer",
"rustc_lint",
"rustc_macros",
"rustc_middle",
"rustc_serialize",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
"rustc_type_ir",
"smallvec",
"tracing",
]

[[package]]
name = "rustc_incremental"
version = "0.0.0"
Expand Down Expand Up @@ -3637,6 +3663,7 @@ dependencies = [
"rustc_expand",
"rustc_hir",
"rustc_hir_analysis",
"rustc_hir_typeck",
"rustc_incremental",
"rustc_lint",
"rustc_macros",
Expand Down
12 changes: 8 additions & 4 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2060,8 +2060,11 @@ impl TyKind {
}

pub fn is_simple_path(&self) -> Option<Symbol> {
if let TyKind::Path(None, Path { segments, .. }) = &self && segments.len() == 1 {
Some(segments[0].ident.name)
if let TyKind::Path(None, Path { segments, .. }) = &self
&& let [segment] = &segments[..]
&& segment.args.is_none()
{
Some(segment.ident.name)
} else {
None
}
Expand Down Expand Up @@ -3039,7 +3042,7 @@ pub type ForeignItem = Item<ForeignItemKind>;
mod size_asserts {
use super::*;
use rustc_data_structures::static_assert_size;
// These are in alphabetical order, which is easy to maintain.
// tidy-alphabetical-start
static_assert_size!(AssocItem, 104);
static_assert_size!(AssocItemKind, 32);
static_assert_size!(Attribute, 32);
Expand All @@ -3060,11 +3063,12 @@ mod size_asserts {
static_assert_size!(Local, 72);
static_assert_size!(Param, 40);
static_assert_size!(Pat, 120);
static_assert_size!(PatKind, 96);
static_assert_size!(Path, 40);
static_assert_size!(PathSegment, 24);
static_assert_size!(PatKind, 96);
static_assert_size!(Stmt, 32);
static_assert_size!(StmtKind, 16);
static_assert_size!(Ty, 96);
static_assert_size!(TyKind, 72);
// tidy-alphabetical-end
}
3 changes: 2 additions & 1 deletion compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,11 @@ where
mod size_asserts {
use super::*;
use rustc_data_structures::static_assert_size;
// These are in alphabetical order, which is easy to maintain.
// tidy-alphabetical-start
static_assert_size!(Lit, 12);
static_assert_size!(LitKind, 2);
static_assert_size!(Nonterminal, 16);
static_assert_size!(Token, 24);
static_assert_size!(TokenKind, 16);
// tidy-alphabetical-end
}
3 changes: 2 additions & 1 deletion compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,11 @@ impl DelimSpan {
mod size_asserts {
use super::*;
use rustc_data_structures::static_assert_size;
// These are in alphabetical order, which is easy to maintain.
// tidy-alphabetical-start
static_assert_size!(AttrTokenStream, 8);
static_assert_size!(AttrTokenTree, 32);
static_assert_size!(LazyAttrTokenStream, 8);
static_assert_size!(TokenStream, 8);
static_assert_size!(TokenTree, 32);
// tidy-alphabetical-end
}
10 changes: 0 additions & 10 deletions compiler/rustc_ast_lowering/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}
}
InlineAsmOperand::Sym { ref sym } => {
if !self.tcx.features().asm_sym {
feature_err(
&sess.parse_sess,
sym::asm_sym,
*op_sp,
"sym operands for inline assembly are unstable",
)
.emit();
}

let static_def_id = self
.resolver
.get_partial_res(sym.id)
Expand Down
50 changes: 18 additions & 32 deletions compiler/rustc_ast_lowering/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_errors::{fluent, AddToDiagnostic, Applicability, Diagnostic, DiagnosticArgFromDisplay};
use rustc_errors::DiagnosticArgFromDisplay;
use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_span::{symbol::Ident, Span, Symbol};

Expand All @@ -12,22 +12,15 @@ pub struct GenericTypeWithParentheses {
pub sub: Option<UseAngleBrackets>,
}

#[derive(Clone, Copy)]
#[derive(Clone, Copy, Subdiagnostic)]
#[multipart_suggestion(ast_lowering::use_angle_brackets, applicability = "maybe-incorrect")]
pub struct UseAngleBrackets {
#[suggestion_part(code = "<")]
pub open_param: Span,
#[suggestion_part(code = ">")]
pub close_param: Span,
}

impl AddToDiagnostic for UseAngleBrackets {
fn add_to_diagnostic(self, diag: &mut Diagnostic) {
diag.multipart_suggestion(
fluent::ast_lowering::use_angle_brackets,
vec![(self.open_param, String::from("<")), (self.close_param, String::from(">"))],
Applicability::MaybeIncorrect,
);
}
}

#[derive(Diagnostic)]
#[diag(ast_lowering::invalid_abi, code = "E0703")]
#[note]
Expand Down Expand Up @@ -62,27 +55,20 @@ pub struct AssocTyParentheses {
pub sub: AssocTyParenthesesSub,
}

#[derive(Clone, Copy)]
#[derive(Clone, Copy, Subdiagnostic)]
pub enum AssocTyParenthesesSub {
Empty { parentheses_span: Span },
NotEmpty { open_param: Span, close_param: Span },
}

impl AddToDiagnostic for AssocTyParenthesesSub {
fn add_to_diagnostic(self, diag: &mut Diagnostic) {
match self {
Self::Empty { parentheses_span } => diag.multipart_suggestion(
fluent::ast_lowering::remove_parentheses,
vec![(parentheses_span, String::new())],
Applicability::MaybeIncorrect,
),
Self::NotEmpty { open_param, close_param } => diag.multipart_suggestion(
fluent::ast_lowering::use_angle_brackets,
vec![(open_param, String::from("<")), (close_param, String::from(">"))],
Applicability::MaybeIncorrect,
),
};
}
#[multipart_suggestion(ast_lowering::remove_parentheses)]
Empty {
#[suggestion_part(code = "")]
parentheses_span: Span,
},
#[multipart_suggestion(ast_lowering::use_angle_brackets)]
NotEmpty {
#[suggestion_part(code = "<")]
open_param: Span,
#[suggestion_part(code = ">")]
close_param: Span,
},
}

#[derive(Diagnostic)]
Expand Down
65 changes: 45 additions & 20 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,32 +387,58 @@ impl<'hir> LoweringContext<'_, 'hir> {
then: &Block,
else_opt: Option<&Expr>,
) -> hir::ExprKind<'hir> {
let lowered_cond = self.lower_expr(cond);
let new_cond = self.manage_let_cond(lowered_cond);
let lowered_cond = self.lower_cond(cond);
let then_expr = self.lower_block_expr(then);
if let Some(rslt) = else_opt {
hir::ExprKind::If(new_cond, self.arena.alloc(then_expr), Some(self.lower_expr(rslt)))
hir::ExprKind::If(
lowered_cond,
self.arena.alloc(then_expr),
Some(self.lower_expr(rslt)),
)
} else {
hir::ExprKind::If(new_cond, self.arena.alloc(then_expr), None)
hir::ExprKind::If(lowered_cond, self.arena.alloc(then_expr), None)
}
}

// If `cond` kind is `let`, returns `let`. Otherwise, wraps and returns `cond`
// in a temporary block.
fn manage_let_cond(&mut self, cond: &'hir hir::Expr<'hir>) -> &'hir hir::Expr<'hir> {
fn has_let_expr<'hir>(expr: &'hir hir::Expr<'hir>) -> bool {
match expr.kind {
hir::ExprKind::Binary(_, lhs, rhs) => has_let_expr(lhs) || has_let_expr(rhs),
hir::ExprKind::Let(..) => true,
// Lowers a condition (i.e. `cond` in `if cond` or `while cond`), wrapping it in a terminating scope
// so that temporaries created in the condition don't live beyond it.
fn lower_cond(&mut self, cond: &Expr) -> &'hir hir::Expr<'hir> {
fn has_let_expr(expr: &Expr) -> bool {
match &expr.kind {
ExprKind::Binary(_, lhs, rhs) => has_let_expr(lhs) || has_let_expr(rhs),
ExprKind::Let(..) => true,
_ => false,
}
}
if has_let_expr(cond) {
cond
} else {
let reason = DesugaringKind::CondTemporary;
let span_block = self.mark_span_with_reason(reason, cond.span, None);
self.expr_drop_temps(span_block, cond, AttrVec::new())

// We have to take special care for `let` exprs in the condition, e.g. in
// `if let pat = val` or `if foo && let pat = val`, as we _do_ want `val` to live beyond the
// condition in this case.
//
// In order to mantain the drop behavior for the non `let` parts of the condition,
// we still wrap them in terminating scopes, e.g. `if foo && let pat = val` essentially
// gets transformed into `if { let _t = foo; _t } && let pat = val`
match &cond.kind {
ExprKind::Binary(op @ Spanned { node: ast::BinOpKind::And, .. }, lhs, rhs)
if has_let_expr(cond) =>
{
let op = self.lower_binop(*op);
let lhs = self.lower_cond(lhs);
let rhs = self.lower_cond(rhs);

self.arena.alloc(self.expr(
cond.span,
hir::ExprKind::Binary(op, lhs, rhs),
AttrVec::new(),
))
}
ExprKind::Let(..) => self.lower_expr(cond),
_ => {
let cond = self.lower_expr(cond);
let reason = DesugaringKind::CondTemporary;
let span_block = self.mark_span_with_reason(reason, cond.span, None);
self.expr_drop_temps(span_block, cond, AttrVec::new())
}
}
}

Expand All @@ -439,14 +465,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
body: &Block,
opt_label: Option<Label>,
) -> hir::ExprKind<'hir> {
let lowered_cond = self.with_loop_condition_scope(|t| t.lower_expr(cond));
let new_cond = self.manage_let_cond(lowered_cond);
let lowered_cond = self.with_loop_condition_scope(|t| t.lower_cond(cond));
let then = self.lower_block_expr(body);
let expr_break = self.expr_break(span, AttrVec::new());
let stmt_break = self.stmt_expr(span, expr_break);
let else_blk = self.block_all(span, arena_vec![self; stmt_break], None);
let else_expr = self.arena.alloc(self.expr_block(else_blk, AttrVec::new()));
let if_kind = hir::ExprKind::If(new_cond, self.arena.alloc(then), Some(else_expr));
let if_kind = hir::ExprKind::If(lowered_cond, self.arena.alloc(then), Some(else_expr));
let if_expr = self.expr(span, if_kind, AttrVec::new());
let block = self.block_expr(self.arena.alloc(if_expr));
let span = self.lower_span(span.with_hi(cond.span.hi()));
Expand Down
12 changes: 10 additions & 2 deletions compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
let ident = *ident;
let mut path = path.clone();
for seg in &mut path.segments {
seg.id = self.next_node_id();
// Give the cloned segment the same resolution information
// as the old one (this is needed for stability checking).
let new_id = self.next_node_id();
self.resolver.clone_res(seg.id, new_id);
seg.id = new_id;
}
let span = path.span;

Expand Down Expand Up @@ -614,7 +618,11 @@ impl<'hir> LoweringContext<'_, 'hir> {

// Give the segments new node-ids since they are being cloned.
for seg in &mut prefix.segments {
seg.id = self.next_node_id();
// Give the cloned segment the same resolution information
// as the old one (this is needed for stability checking).
let new_id = self.next_node_id();
self.resolver.clone_res(seg.id, new_id);
seg.id = new_id;
}

// Each `use` import is an item and thus are owners of the
Expand Down
Loading