Skip to content

Rollup of 16 pull requests #25172

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 41 commits into from
Closed
Changes from 5 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d6227dc
Added error explanations for E0308, E0309, and E0310
cactorium Apr 18, 2015
99d2552
Fix typo
cactorium Apr 19, 2015
4420f31
Fix trailing whitespaces
cactorium Apr 19, 2015
52e520e
rustc: Improve misleading error message for E0282
ruuda Apr 29, 2015
6b292cd
rustc: Add long diagnostics for E0282
ruuda Apr 29, 2015
414dfb1
rustc: Improve long diagnostics for E0282
ruuda Apr 30, 2015
685a6f7
Update "Miscellaneous attributes" section of reference manual
jooert May 2, 2015
93c0614
Update with correct output.
janne May 5, 2015
4b8098b
test: Update expected compile-fail message for E0282
ruuda May 5, 2015
cdb6e1e
Correct a typo in a declared token in the reference grammar
carols10cents May 5, 2015
1ca9ed6
Declare other tokens used later in the reference grammar
carols10cents May 5, 2015
9c7d5ae
Panic if the grammar verifier sees a token it doesn't recognize
carols10cents May 5, 2015
dff7676
Fix MIPS build errors in libstd/os/linux/raw.rs
kevinmehall May 5, 2015
6c6b200
Add TCP_* constants for mips/mipsel Linux
kevinmehall May 5, 2015
705f355
Fix indentation in the "Strings" chapter
hibariya May 6, 2015
8227db8
fix typos caught by codespell
tshepang May 5, 2015
fc9bc77
Fix explanation of Cargo's behavior
steveklabnik May 6, 2015
085e1f4
doc: Fix link of repr attribute
rydotyosh May 6, 2015
4174aa4
Reword with pnkfelix's suggestion
cactorium May 6, 2015
45c461c
Add note about type signature searching to docs
piatra May 6, 2015
81b90bd
Correct initial guessing game example. Fixes #25147. r? @steveklabnik
banks May 6, 2015
1d6285e
Iter Docs: Mention 'reduce' and 'inject'
killercup May 6, 2015
08923fb
doc: Fix remove unused variable
rydotyosh May 6, 2015
1884c87
doc: Fix remove secret number at final source
rydotyosh May 6, 2015
bfdbda2
Remove schedule_free_slice
michaelwu May 6, 2015
592d271
Rollup merge of #24576 - cactorium:errorcodes, r=pnkfelix
steveklabnik May 7, 2015
ee80321
Rollup merge of #24966 - ruud-v-a:explain, r=pnkfelix
steveklabnik May 7, 2015
3080809
Rollup merge of #25052 - jooert:misc_attr_reference, r=steveklabnik
steveklabnik May 7, 2015
f59f07d
Rollup merge of #25131 - janne:patch-1, r=alexcrichton
steveklabnik May 7, 2015
872132f
Rollup merge of #25137 - carols10cents:fix-token-declaration, r=alexc…
steveklabnik May 7, 2015
fa55b4c
Rollup merge of #25138 - tshepang:typos, r=sanxiyn
steveklabnik May 7, 2015
c13c3f9
Rollup merge of #25139 - hibariya:fix-indentation, r=alexcrichton
steveklabnik May 7, 2015
a9d696f
Rollup merge of #25140 - kevinmehall:mips, r=sanxiyn
steveklabnik May 7, 2015
7b643df
Rollup merge of #25141 - steveklabnik:fix_guessing_game, r=huonw
steveklabnik May 7, 2015
901f334
Rollup merge of #25142 - rydotyosh:patch-1, r=alexcrichton
steveklabnik May 7, 2015
5f6b588
Rollup merge of #25144 - killercup:docs/iter-fold-reduce, r=steveklabnik
steveklabnik May 7, 2015
2e9cc99
Rollup merge of #25146 - piatra:doc-search-patch, r=steveklabnik
steveklabnik May 7, 2015
54eb0aa
Rollup merge of #25148 - banks:master, r=steveklabnik
steveklabnik May 7, 2015
26ff571
Rollup merge of #25154 - rydotyosh:patch-3, r=steveklabnik
steveklabnik May 7, 2015
e53cd43
Rollup merge of #25156 - rydotyosh:patch-4, r=alexcrichton
steveklabnik May 7, 2015
6499747
Rollup merge of #25160 - michaelwu:remove-schedule_free_slice, r=cmr
steveklabnik May 7, 2015
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
58 changes: 55 additions & 3 deletions src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,65 @@ number cannot be negative.
E0307: r##"
The length of an array is part of its type. For this reason, this length must be
a compile-time constant.
"##,

E0308: r##"
This error occurs when the compiler was unable to infer the concrete type of a
variable. This error can occur for several cases, the most common of which is a
mismatch in the expected type that the compiler inferred for a variable's
initializing expression, and the actual type explicitly assigned to the
variable.

For example:

let x: i32 = "I am not a number!";
// ~~~ ~~~~~~~~~~~~~~~~~~~~
// | |
// | initializing expression;
// | compiler infers type `&str`
// |
// type `i32` assigned to variable `x`
"##,

E0309: r##"
Types in type definitions have lifetimes associated with them that represent
how long the data stored within them is guaranteed to be live. This lifetime
must be as long as the data needs to be alive, and missing the constraint that
denotes this will cause this error.

// This won't compile because T is not constrained, meaning the data
// stored in it is not guaranteed to last as long as the reference
struct Foo<'a, T> {
foo: &'a T
}

// This will compile, because it has the constraint on the type parameter
struct Foo<'a, T: 'a> {
foo: &'a T
}
"##,

E0310: r##"
Types in type definitions have lifetimes associated with them that represent
how long the data stored within them is guaranteed to be live. This lifetime
must be as long as the data needs to be alive, and missing the constraint that
denotes this will cause this error.

// This won't compile because T is not constrained to the static lifetime
// the reference needs
struct Foo<T> {
foo: &'static T
}

// This will compile, because it has the constraint on the type parameter
struct Foo<T: 'static> {
foo: &'static T
}
"##

}


register_diagnostics! {
E0011,
E0012,
Expand Down Expand Up @@ -571,9 +626,6 @@ register_diagnostics! {
E0300, // unexpanded macro
E0304, // expected signed integer constant
E0305, // expected constant
E0308,
E0309, // thing may not live long enough
E0310, // thing may not live long enough
E0311, // thing may not live long enough
E0312, // lifetime of reference outlives lifetime of borrowed content
E0313, // lifetime of borrowed pointer outlives lifetime of captured variable
Expand Down