10000 Rollup of 13 pull requests by Centril · Pull Request #65368 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 13 pull requests #65368

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

Merged
merged 33 commits into from
Oct 13, 2019
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
334bafe
Document current deny by default lints
197g Oct 3, 2019
4bb1592
Suggest `if let` on `let` refutable binding
estebank Oct 9, 2019
5bb0a03
Move diagnostics code out of the critical path
estebank Oct 11, 2019
91cf02c
Implement Clone::clone_from for VecDeque
crgl Oct 3, 2019
10671f1
Add tests for VecDeque clone_from
crgl Oct 3, 2019
d21eeb1
Override nth for VecDeque Iter and IterMut
crgl Oct 4, 2019
7140c02
resolve: fix error title regarding private constructors
da-x Oct 11, 2019
9d11bda
resolve: shorten wording on private constructor error
da-x Oct 11, 2019
05db5a2
Report lint in external macros
memoryruins Oct 11, 2019
95a65cd
Add regression test for CONST_ERR lints in extern macros
memoryruins Oct 11, 2019
e039534
replace the hand-written binary search with the library one
Oct 12, 2019
d8c2956
Improve docs on some char boolean methods
Oct 6, 2019
a2b2362
do not reference LLVM for our concurrency memory model
RalfJung Oct 12, 2019
63cb2fa
compress the function, remove the assert check.
Oct 12, 2019
f363550
it's C++20
RalfJung Oct 12, 2019
d6ab45d
fix link targets
RalfJung Oct 12, 2019
9f09387
syntax: simplify maybe_annotate_with_ascription
Centril Oct 8, 2019
477a68b
simplify maybe_stage_features
Centril Oct 8, 2019
7effe63
simplify integer_lit
Centril Oct 8, 2019
94db37a
mbe: reduce panictry! uses.
Centril Oct 8, 2019
d0f8bd6
Rollup merge of #65039 - HeroicKatora:deny-by-default-book, r=Guillau…
Centril Oct 13, 2019
4dc0b8a
Rollup merge of #65069 - crgl:clone-from-vec-deque, r=bluss
Centril Oct 13, 2019
82fb193
Rollup merge of #65165 - BO41:char_docs, r=varkor
Centril Oct 13, 2019
963e4bc
Rollup merge of #65248 - estebank:mention-if-let, r=cramertj
Centril Oct 13, 2019
540278c
Rollup merge of #65250 - da-x:ctor-in-error-msgs, r=petrochenkov
Centril Oct 13, 2019
433ea1a
Rollup merge of #65295 - estebank:gotta-go-fast, r=nnethercote
Centril Oct 13, 2019
643261a
Rollup merge of #65320 - memoryruins:const_err, r=oli-obk
Centril Oct 13, 2019
af8a6e5
Rollup merge of #65327 - guanqun:remove-hand-binary-search, r=petroch…
Centril Oct 13, 2019
293d02d
Rollup merge of #65339 - RalfJung:atomic-ordering, r=Centril
Centril Oct 13, 2019
b143aa2
Rollup merge of #65357 - Centril:simplify-maybe-annotate-with-ascript…
Centril Oct 13, 2019
5af528a
Rollup merge of #65358 - Centril:smsf, r=davidtwco
Centril Oct 13, 2019
af54a3e
Rollup merge of #65359 - Centril:sil, r=davidtwco
Centril Oct 13, 2019
b828591
Rollup merge of #65360 - Centril:mbrpt, r=petrochenkov
Centril Oct 13, 2019
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
syntax: simplify maybe_annotate_with_ascription
  • Loading branch information
Centril committed Oct 13, 2019
commit 9f09387f53792740edcb5dd0eea49ab02d3fe891
20 changes: 11 additions & 9 deletions src/libsyntax/parse/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::ast::{
self, Param, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind, Ident, Item, ItemKind,
Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind, VariantData,
};
use crate::feature_gate::{feature_err, UnstableFeatures};
use crate::feature_gate::feature_err;
use crate::parse::{SeqSep, PResult, Parser, ParseSess};
use crate::parse::parser::{BlockMode, PathStyle, SemiColonMode, TokenType, TokenExpectType};
use crate::parse::token::{self, TokenKind};
Expand Down Expand Up @@ -387,14 +387,17 @@ impl<'a> Parser<'a> {
let next_pos = sm.lookup_char_pos(self.token.span.lo());
let op_pos = sm.lookup_char_pos(sp.hi());

let allow_unstable = self.sess.unstable_features.is_nightly_build();

if likely_path {
err.span_suggestion(
sp,
"maybe write a path separator here",
"::".to_string(),
match self.sess.unstable_features {
UnstableFeatures::Disallow => Applicability::MachineApplicable,
_ => Applicability::MaybeIncorrect,
if allow_unstable {
Applicability::MaybeIncorrect
} else {
Applicability::MachineApplicable
},
);
} else if op_pos.line != next_pos.line && maybe_expected_semicolon {
Expand All @@ -404,14 +407,13 @@ impl<'a> Parser<'a> {
";".to_string(),
Applicability::MaybeIncorrect,
);
} else if let UnstableFeatures::Disallow = self.sess.unstable_features {
err.span_label(sp, "tried to parse a type due to this");
} else {
} else if allow_unstable {
err.span_label(sp, "tried to parse a type due to this type ascription");
} else {
err.span_label(sp, "tried to parse a type due to this");
}
if let UnstableFeatures::Disallow = self.sess.unstable_features {
if allow_unstable {
// Give extra information about type ascription only if it's a nightly compiler.
} else {
err.note("`#![feature(type_ascription)]` lets you annotate an expression with a \
type: `<expr>: <type>`");
err.note("for more information, see \
Expand Down
0